            iter max-iters]
       ; make sure we don't use clusters where k < k
       (let [new-clusters (cluster-step data-iter k clusters)]
-        (if (= iter 0)
-        ;(if (or (= iter 0) (same-clustering? new-clusters clusters))
+        ;(if (= iter 0)
+        (if (or (= iter 0) (same-clustering? new-clusters clusters))
           new-clusters
           (recur new-clusters (dec iter)))))))
 

         :positions (conj (:positions clst) (last item))))


; XXX - needs to be fixed...
(defn same-clustering? [clsts1 clsts2 & [threshold]]
  (let [cntrs #(sort (map :center %))]
    (every? identity
      #(< (distance %1 %2) threshold)
      (zip (cntrs clsts1) (cntrs clsts2)))))



(def play-data
  {:ptpts  ["a" "b" "c"]
   :cmts   ["x" "y" "z"]
   :matrix (matrix [[1 2 3] [4 2 3] [1 2 0]])})

(def clst (init-clusters play-data 2))
(def clst (kmeans play-data 2))
