                                    @max-undos
                                    (conj @undo-explain-list @app-explain))))
   (reset! app-explain explanation))
+
 
 (defn undos?
   []

(def ^:private undo-explain-list (reagent/atom []))   ;; mirrors undo-list
(def ^:private redo-explain-list (reagent/atom []))   ;; mirrors redo-list


(defn clear-history!
  []
  (reset! undo-list [])
  (reset! redo-list [])
  (reset! undo-explain-list [])
  (reset! redo-explain-list [])
  (reset! app-explain ""))


(defn store-now!
  "stores the value currently in app-db, so the user can later undo"
  [explanation]
  (reset! redo-list [])           ;; clear and redo state created by previous undos
  (reset! redo-explain-list [])   ;; clear and redo state created by previous undos
  (reset! undo-list (vec (take
                           @max-undos
                           (conj @undo-list @app-db))))

(handlers/register-base     ;; not a pure handler
  :undo                     ;; usage:  (dispatch [:undo n])
  (fn handler
    [_ [_ n clear-redos?]]
    ;; if n absent, defaults to 1. If clear-redos? absent, defaults to false.
    (if-not (undos?)
      (warn "re-frame: you did a (dispatch [:undo]), but there is nothing to undo.")
      (do
        (undo-n (or n 1))
        (when clear-redos? (clear-redos!))))))


(defn- redo
