         (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)
+     (board-size-slider size command)
      [:div
       [:label "Analysis Mode"]
       [:input {:type "checkbox" :checked analysis-mode

           :analysis-mode false}))

(defn new-board! [& args]
  #(swap! app-state assoc :board (apply b/create-board args)))

(defn slide! [arg]
  (swap! app-state update-in [:board] b/slide arg))

(defn board-size-slider [size]
  [:div
   [:button {:on-click (new-board! size)} "Reset"]
   [:button {:on-click (new-board! size :shuffle)} "Shuffle"]
   [:label (str "Board size: " size)]
   [:input {:type "range" :style {:width "25%"}
            :value size :min 2 :max 8

   39 :right
   38 :up
   40 :down
   78 :new-game
   82 :reset
   83 :solve})

(defn handle-keydown [command]
