     (if (= (count coords) 2)
       ; use the heuristic if there are no intermediate points
       [(wu-barsky-heuristic (first coords) (last coords) tan1 tan2)]
-      (let [iter-error (* fit-error fit-error)
-            params (chord-parameterize coords)
+      (let [params (chord-parameterize coords)
             bezier (gen-bezier coords params tan1 tan2)
             [max-error split-point] (compute-max-error coords bezier params)]
-        (if (< max-error iter-error)
-          [bezier]
+        (if (< max-error fit-error)
+          [(adjust-bezier bezier coords params tan1 tan2
+                          adjust-error max-adjust-iter)]
           (let [center-tan (v2-center-tangent
                              (nth coords (dec split-point))
                              (nth coords split-point)

            (v2-scale (B1 t) (:v1 bezier)))
    (v2-add (v2-scale (B2 t) (:v2 bezier))
            (v2-scale (B3 t) (:v3 bezier)))))

(defn wu-barsky-heuristic [bez0 bez3 tan1 tan2]
  (let [dist (/ (v2-dist bez0 bez3) 3.0)]

               (v2-add bez3 (v2-scale alpha2 tan2))
               bez3))))

(def fit-error 16.0)
(def adjust-error 4.0)
(def max-adjust-iter 10)

(defn compute-max-error [coords bezier params]
  (->>
