                       (disj cells cell)
                       (conj cells cell))))))
                   
+(defn random-cells
+  [[width height]]
+  (set (filter #(> (Math/random) 0.5) 
+               (for [x (range 0 width) 
+                     y (range 0 width)] 
+                 (vector x y)))))
+
+(defonce app-state (atom {:cells #{} 
+                          :bounds [50 20]
+                          :playing? false 
+                          :cell-size 20
+                          :speed 5}))
+
+(defn reset-random!
+  []
+  (swap! app-state (fn [{b :bounds :as s}] (assoc s :cells (random-cells b))))) 
 
 (defn world
   [app owner]

           app-state
           {:target (. js/document (getElementById "app"))}))

(defn random-cells
  [[width height]]
  (set (filter #(> (Math/random) 0.5) 
               (for [x (range 0 width) 
                     y (range 0 width)] 
                 (vector x y)))))

(defonce app-state (atom {:cells (random-cells [50 20])
                          :bounds [50 20]
                          :playing? false 
                          :cell-size 20
                          :speed 50}))
(defn main []
  (draw! app-state)
  (live! app-state))

            [om.dom :as dom :include-macros true]
            [cljs.core.async :refer (timeout <!)])
  (:require-macros [cljs.core.async.macros :refer (go)]))

(defn add-timer
  [f prefix]
  (fn [& args]
    (let [t (js/Date.)
          r (apply f args)
          t2 (js/Date.)]
      (js/console.log prefix (- t2 t))
      r)))

(defn neighbors
  "Given a set of cells returns a seq of adjacent cells. If n cells share a 
