         b (flatten (map rest v))
         x (float (/ (reduce + a) (count a)))
         y (float (/ (reduce + b) (count b)))]
-        [x y])))
-
+        (list x y))))
 
 (defn mean-centroids
   "Calculates the mean for a given centroid"

  (:require [k-means.vector :as vector]))

(defn mean-2dvec
  [v]
  (cond
    (empty? v) v
    :else


(defn group-clusters
  "group a list of cluster groups into one cluster group"
  ([^ints l] (group-clusters l (vector/make-list (count l))))
  ([^ints l ^ints a]
    (cond
      (empty? l) a
      :else
        (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"
  [^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))))
