                                                                                       (and (.-metaKey e)  :meta)
                                                                                       ]))
                                current-path      (:selected (om/get-state owner))
+                               ; index of current node in parent's children
+                               current-child-idx (last current-path)
                                ; is path root?
-                               is-root           (= [:body 0] current-path)
+                               is-root           (= root-path current-path)
                                ; current node
                                current           (get-in @data current-path)
                                ; parent path
-                               parent-path       (subvec current-path 0 (- (count current-path) 2))
+                               parent-path       (and (not is-root) (subvec current-path 0 (- (count current-path) 2)))
                                ; parent node
-                               parent            (get-in @data parent-path)
+                               parent            (and parent-path (get-in @data parent-path))
                                ; children of parent
-                               parent-children   (get parent :children false)
-                               ; index of current node in parent's children
-                               current-child-idx (last current-path)
+                               parent-children   (and parent (get parent :children false))
                                ;; shared paths
                                ;; ----------------------------------------------------
                                ;; up - lesser sibling in parent
                                ;;    - no change
-                               up-path (cond is-root current-path
-                                             (get parent-children (dec current-child-idx) false)
-                                                (conj parent-path :children (dec current-child-idx))
-                                             :else false)
+                               up-path           (cond is-root false 
+                                                       (get parent-children (dec current-child-idx) false)
+                                                       (conj parent-path :children (dec current-child-idx))
+                                                       :else false)
                                ;; down - greater sibling in parent
                                ;;      or no change
-                               down-path (if (get parent-children (inc current-child-idx) false)
-                                             (conj parent-path :children (inc current-child-idx))
-                                             false)
+                               down-path         (if (get parent-children (inc current-child-idx) false)
+                                                     (conj parent-path :children (inc current-child-idx))
+                                                     false)
                                ]
                            
                            (case command
-                             nil (recur)
                              :cursor-up
-                               (om/set-state! owner :selected (if up-path up-path current-path))
+                               (when up-path (om/set-state! owner :selected up-path))
                              :cursor-down
-                               (om/set-state! owner :selected (if down-path down-path current-path))
+                               (when down-path (om/set-state! owner :selected down-path))
                              :cursor-left
                                (om/set-state! owner :selected
                                               (if is-root current-path
                                                   (gen-left-path current-child-idx parent-path
-                                                                 up-path data)
-                                                  ))
+                                                                 up-path data)))
                              
                              :cursor-right
                                (om/set-state! owner :selected

   [om-tools.dom :as dom :include-macros true]
   ))


(defcomponent outline-head [head owner]
  (render [_]

                  (om/build-all outline-body (:children node) {:state state}))
                 ))) 

(defcomponent component [data owner]
  (init-state [_]
              (let [key-down-chan (listen js/window "keydown")
                    click-chan    (chan)
                    root-path     (om/path data)]
                (go (loop []
                      (alt!
                        ; key down events
                        ; -------------------------------------------------------------------------------
                        key-down-chan
                        ([e c]
                         
