 
 (defn group-clusters
   "group a list of cluster groups into one cluster group"
-  ([l] (group-clusters l (vector/make-vector (count l)) 0))
-  ([l a i]
+  ([^ints l] (group-clusters l (vector/make-list (count l))))
+  ([^ints l ^ints a]
     (cond
-      (empty? l) (vec (pmap first a))
+      (empty? l) a
       :else
-        (recur (rest l) (assoc a i (conj (nth a i) (nth (first l) i))) (inc i)))))
+        (recur (rest l) (map into (first l) a)))))
 
 (defn cluster-p
   "take a list of vectors and cluster on centroids c via distance in parallel"
-  ([l c] (cluster-p l c []))
-  ([l c a]
+  [^ints l ^floats c]
     (let [clusters (for [i (partition-all (int (/ (count l) (count c))) l) :let [m (future (p :cluster (cluster-m i c)))]] (deref m))]
-      (p :group-clusters (group-clusters clusters)))))
+      (p :group-clusters (group-clusters clusters))))

      :else
        (recur (rest g) (conj l (p :mean-2dvec (mean-2dvec (first g))))))))

(defn distance
  "Implements euclidian distance between two vectors"
  ([c1 c2]
    (->> (map - c1 c2) (map #(* % %)) (reduce +))))


(defn distance-p
  "Implements euclidian distance between two vectors"
  ([c1 c2]
    (->> (pmap - c1 c2) (pmap #(* % %)) (reduce +))))
(def distance-p-m (memoize distance-p))

(defn min-index
  [c]

        b (flatten (map rest v))
        x (float (/ (reduce + a) (count a)))
        y (float (/ (reduce + b) (count b)))]
        (list x y))))

(defn mean-centroids
  "Calculates the mean for a given centroid"
