         (str tile)]])))
 
 (defn tile-grid []
-  (let [{:keys [board size]} @app-state
+  (let [{:keys [board size analysis-mode]} @app-state
         dim (b/dimension board)]
     [:center
      [:h1 "Tile Puzzle"]

      (for [x (range dim) y (range dim)]
        (let [tile (nth board (+ (* y dim) x))]
          (render-tile [x y] tile)))]
     [:div (if (b/solved? board)
             "Solved!"
             (str "Suggested Moves: " (b/solve-next board)))]
     (board-size-slider size)
     [:p
      "© 2017 Charles L.G. Comstock "
      [:a {:href "https://github.com/dgtized/tile-game"} "(github)"]]]))


(defonce app-state
  (r/atom {:board (b/create-board 4)
           :size 4
           :analysis-mode false}))

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