          coords params (range (count coords)))
     ; collect max and split-point
     (reduce (fn [[max-dist split-point :as res-pair] [i dist]]
-              (if [>= dist max-dist] [dist i] res-pair))
+              (if (>= dist max-dist) [dist i] res-pair))
             [0.0 (/ (count coords) 2)])))
 
 (defn fit-cubic

          (conj (first coords)) vec (conj (last coords)))))))

(defn smooth-stroke [stroke]
  (Stroke.
    (interpolate-points (:coords stroke) 10.0)
    (:thickness stroke)))

(defn bezier3-pw-calc [beziers t]
  (let [i (int t)]
    (bezier3-calc (nth beziers i) (- t i))))

; having duplicate adjacent points screws up the distance
; calculations, so we need to remove them before doing the fitting
(defn dedup-points [coords]
  (reduce (fn [result c]
            (if (= 0 (v2-dist (last result) c))
              result
              (conj result c)))
          [] coords))

(defn interpolate-points [coords desired-seg-len]
  (let [path-len (path-length coords)]
