   "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! redo-explain-list [])   ;; clear and redo state created by previous undos
   (reset! undo-list (vec (take
                            @max-undos
                            (conj @undo-list @app-db))))



(subs/register
  :undo-explantions
  (fn handler
    ; "returns a vector of string explnations
    [_ _]
    (reaction (deref undo-explain-list))))

(subs/register
  :redo-explantions
  (fn handler
    ; "returns a vector of string explnations
    [_ _]
    (reaction (deref redo-explain-list))))

;; -- event handlers  ----------------------------------------------------------------------------


(defn undo
  [undos cur redos]
  (let [u @undos
        r (cons @cur @redos)]

    (reset! redos r)
    (reset! undos (pop u))))

(defn- undo-count
  "undo until we reach count or run out of undos"
  [count]
  (when (and (pos? count) (undos?))
    (undo undo-list app-db redo-list)
    (undo undo-explain-list app-explain redo-explain-list)
    (recur (dec count))))

(handlers/register-base     ;; not a pure handler
  :undo                     ;; usage:  (dispatch [:undo n])
  (fn handler
    [_ event-v]
    (if-not (undos?)
      (warn "re-frame: you did a (dispatch [:undo]), but there is nothing to undo.")
      (undo-count (if (second event-v) (second event-v) 1)))))


(defn- redo
