 (def current-branch (atom {:id (generate-uuid) :data (atom [])}))
 
 ;; global atom referencing the total history graph
-(def app-history (atom {:root @current-branch :data (@current-branch :data)}))
+(def app-history (atom {:id 1 :root @current-branch :data (@current-branch :data)}))
 
 ;; ffd
 (def history-view)
+
+;; this variable indicates that we are currently reverted to an earlier
+;; state of the branch and also which one we have reverted to
+(def reverted-to (atom -1))
 
 (defn most-recent-state []
   (let [l (len @(@current-branch :data))]

  (reset! current-branch branch)
  (when-let [s (most-recent-state)]
    (reset! app-state s))
  (render-tree @app-history @current-branch (fn [branch] (switch-to-branch branch))))

(defn nth-history 
  ([i] 

(defn branch-morph [posX posY width height branch]
         {:id (branch :id)
          :morph {:Position {:x posX :y posY}
                  :onClick (fn [this] (switch-to-branch branch))}
          :shape {:Fill "green"
                  :BorderColor "darkgreen"
                  :Extent {:x width :y height}}
