      [:div
       [:div {:class "half-size"}
        [:button {:on-click #(start-game!)
-                      :disabled running?
-                      :class "full-btn green"} "PLAY"]]
+                 :disabled running?
+                 :class "full-btn green"} "PLAY"]]
       [:div {:class "half-size"}
        [:button {:on-click #(stop-game!)
                  :disabled (not running?)


(enable-console-print!)


(defonce empty-grid (utils/create-empty-grid 40 40))

(def rows  40)
(def columns 40 )

(def app-state (atom {:grid empty-grid
                      :preview nil
                      :timer nil
                      :settings {:cell-size 10
                                 :board-width 400
                                 :board-height 400
                                 :live-cell-color "red"
                                 :dead-cell-color "white"
                                 :preview-color "#b3b3b3"
                                 :interval 500}}))

;; Patterns

(defonce glider (utils/expand-to [[0 1 0]
                                  [0 0 1]
                                  [1 1 1]] rows columns))

(defonce lwss (utils/expand-to [[0 1 0 0 1]
                                [1 0 0 0 0]
                                [1 0 0 0 1]
                                [1 1 1 1 0]] rows columns))

(defonce mwss (utils/expand-to [[0 0 0 1 0 0]
                                [0 1 0 0 0 1]
                                [1 0 0 0 0 0]
                                [1 0 0 0 0 1]
                                [1 1 1 1 1 0]] rows columns))

(defonce hwss (utils/expand-to [[0 0 0 1 1 0 0]
                                [0 1 0 0 0 0 1]
                                [1 0 0 0 0 0 0]
                                [1 0 0 0 0 0 1]
                                [1 1 1 1 1 1 0]] rows columns))

(defn set-preview [preview-matrix]
  (swap! app-state update-in [:preview] (constantly preview-matrix)))


   [:div
    [:h5 "space ships"]
    [:div
     (pattern-button glider "Glider")
     (pattern-button lwss "LW space ship")
     (pattern-button mwss "MW space ship")
     (pattern-button hwss "HW space ship")]]

   [:div
    [:h5 "Oscillators"]
    (pattern-button pulsar "Pulsar")
    (pattern-button figure-8 "Figure 8")
    (pattern-button queenbee "Queen bee shuttle")
    (pattern-button twinbee "Twin bees shuttle")]])

;; -------------------------
;; Initialize app
