             [{; id nessecary? not for now... we do not alter the morph structure but just rerender it completely
              :morph {:MorphClass "Path"
                      :Position start-point
-                     :onClick (fn [e] 
-                                (prn "switching via fork click to branch " (get-in cont [:root :id]))
+                     :onClick (fn [this] 
                                 (@branch-callback-fn (cont :root))
                                 false)}
              :shape {:ShapeClass "Path"

            :PathElements (smoothen (map #(translat - % start) [start (assoc end :x (start :x)) end]))}})

(defn render-fork [branch cont fork start-point]
  (let [fill (if (is-on-current cont) "green" "black")
        end-point {:x (count branch) :y 0} ; based on start-point and number of entries
        [cont-path cont-space] (render-branch cont end-point) ; we have a fork, return a path that visualizes branching
        fork-start-point {:x (+ (end-point :x) 10) :y cont-space} ; based on end-point and space occupation of the cont
        [fork-path fork-space] (render-branch fork fork-start-point)

;
; Data structure:
;
; {:id ... :data -> [ . . . .  {:cont ---------------------> {:root . :data -> [ . . . . . ]} 
;                            :fork | }]}
;                                  \                        
;                                   V                      
;                                  {:id ... :data -> [ . . . . . { . . }]}

(def current-branch-ref (atom nil)) ;; supplied by the user of the module
(def branch-callback-fn (atom (fn [branch] (prn "Clicked on me!"))))
(def reverted-index (atom -1))
(def rendered-tree (atom nil))

(def highlighted-branches (atom {}))

(def history-marker {:morph {:Position {:x 0 :y 1}}
                     :shape {:Fill "lightgreen"
                             :Extent {:x 5 :y 5}}})


; TODO visualize the movement of one branch into the other

(defn is-on-current [branch]
  (if @current-branch-ref
