 
    [:div
     [:h5 "space ships"]
-
     [:div
-     [:button {:on-click #(set-pattern glider)
-               :on-mouse-over #(set-preview glider)
-               :on-mouse-out #(set-preview nil)
-               :class "small-btn blue"} "Glider"]
-     [:button {:on-click #(set-pattern lwss)
-               :on-mouse-over #(set-preview lwss)
-               :on-mouse-out #(set-preview nil)
-               :class "small-btn blue"} "LW space ship"]
-     [:button {:on-click #(set-pattern mwss)
-               :on-mouse-over #(set-preview mwss)
-               :on-mouse-out #(set-preview nil)
-               :class "small-btn blue"} "MW space ship"]
-     [:button {:on-click #(set-pattern hwss)
-               :on-mouse-over #(set-preview hwss)
-               :on-mouse-out #(set-preview nil)
-               :class "small-btn blue"} "HW space ship"]
-     ]
-    ]])
+     (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

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

  (stop-game!)
  (swap! app-state update-in [:grid] (constantly empty-grid)))

;; -------------- Patterns ----------------

;; Space ships

(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))

;; Oscillators

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

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

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

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





;; -------------------------
;; View

(defn pattern-button [pattern-matrix name]
  [:button {:on-click #(set-pattern pattern-matrix)
            :on-mouse-over #(set-preview pattern-matrix)
            :on-mouse-out #(set-preview nil)
            :class "small-btn blue"} name])

(defn game-of-life []
  [:div {:style {:margin "0px 0px 0px 0px"}}
