                                  :stroke "#ccccce"
                                  :stroke-width "0.5"}}))))
 
-(defn toggle-play-state
-  [state _]
-  (om/transact! state [:playing?] not))
-
-
-(defn event->cell
-  [event cell-size] 
-  (vector (quot (- (.-clientX event) 8) cell-size)
-          (quot (- (.-clientY event) 28) cell-size)))
-
-(defn handle-world-click
-  [state cell-size e]
-  (let [cell (event->cell e cell-size)]
-    (om/transact! state [:cells] 
-                  (fn [cells] 
-                    (if (contains? cells cell)
-                      (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
+  "Om component for the world."
   [app owner]
   (reify
     om/IRender

                        (cell-els width height cell-size cells)))))))

(defn draw!
  [app-state]
  (om/root world
           app-state
           {:target (. js/document (getElementById "app"))}))


(defn main []
  (draw! app-state)
  (live! app-state))

            [cljs.core.async :refer (timeout <!)])
  (:require-macros [cljs.core.async.macros :refer (go)]))


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