   [c v]
     (for [i c :let [d (distance i v)]] d))
 
+(defn make-vector-rand
+  "create a vector containing n cols populated with random data"
+  ([n] (make-vector-rand n []))
+  ([n c]
+  (cond
+    (<= n 0) c
+    :else
+      (recur (dec n) (conj c [(rand-int 5000) (rand-int 5000)])))))
+
 (defn make-vector
   "create a vector containing n cols"
   ([n] (make-vector n []))


(defn cluster
  "take a vector and cluster it via distance"
  [g l c]
  (cond
    (nil? g) (recur (make-vector (count c)) l c)
    (not-empty l)
      (let [i (min-index (min-distance c (first l)))]
        (recur (assoc g i (conj (nth g i) (first l))) (rest l) c))
    :else
    g))

(defn min-vector
  "Chooses the smallest vector in a set of vectors"

(defn -main
  "Main function for k-means"
  [& args]
  (let [c (k-means (make-vector-rand 5000) 5 100)] (println c)))
