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

      (let [b @(@current-branch :data)]
        (when-not (= (last b) n)
          (append-to-branch (@current-branch :data) n))
        (let [c (len @(@current-branch :data))]
            (render-tree @app-history @current-branch (fn [branch] (switch-to-branch branch)))
            (prn (str c " Saved " (pluralize c "State")))))))

(om/root

(def current-branch (atom {:id (generate-uuid) :data (atom [])}))

;; global atom referencing the total history graph
(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))]
