            :analysis-mode false}))
 
 (defn new-board! [& args]
-  #(swap! app-state assoc :board (apply b/create-board args)))
+  (swap! app-state assoc :board (apply b/create-board (:size @app-state) args)))
 
 (defn slide! [arg]
   (swap! app-state update-in [:board] b/slide arg))
 
-(defn board-size-slider [size]
+(defn board-size-slider [size command]
   [:div
-   [:button {:on-click (new-board! size)} "Reset"]
-   [:button {:on-click (new-board! size :shuffle)} "Shuffle"]
+   [:button {:on-click #(async/put! command :reset)} "Reset"]
+   [:button {:on-click #(async/put! command :new-game)} "Shuffle"]
    [:label (str "Board size: " size)]
    [:input {:type "range" :style {:width "25%"}
             :value size :min 2 :max 8

    (when-let [key (async/<! command)]
      (async/close! cancel)
      (let [new-cancel (async/chan 1)]
        (if (= key :solve)
          (playback-solution new-cancel 250)
          (slide! key))
        (recur new-cancel)))
    (recur cancel)))

        (let [tile (nth board (+ (* y dim) x))]
          (render-tile [x y] tile command)))]
     [:h4 (if (b/solved? board) "Solved!" "Slide tiles with arrow keys or clicking on tile")]
     (board-size-slider size command)
     [:div
      [:label "Analysis Mode"]
      [:input {:type "checkbox" :checked analysis-mode
