 (with-test 
   (def complete-nodes* 
     (fn [id nodes] 
-      (cond (empty? nodes) '()
-            :else (cons (complete-node* id (first nodes)) (complete-nodes* id (rest nodes))))))
+      (cond (nil? nodes) nil
+            (empty? nodes) '()
+            :else (cons (complete-node* id (first nodes)) 
+                        (complete-nodes* id (rest nodes))))))
+
+  (is (= (complete-nodes* 1 nil)
+         nil))
 
   (is (= (complete-nodes* 1 '())
          '()))

  (is (= (leftmost-node {:id 1 :nodes '({:id 2} {:id 3})}) 
         {:id 2}))

  (is (= (leftmost-node {:id 1 :nodes '({:id 2 :nodes ({:id 3})})}) 
         {:id 3})))

(with-test

         {:id 1 :nodes '({:id 2} {:id 3} {:id 4 :complete true})}))
  
  (is (= (complete-node* 2 {:id 1 :nodes '({:id 2 :nodes ({:id 3})})})
         {:id 1 :nodes '({:id 2 :complete true :nodes ({:id 3})})}))

  (is (= (complete-node* 3 {:id 1 :nodes '({:id 2 :nodes ({:id 3} {:id 4})})})
         {:id 1 :nodes '({:id 2 :nodes ({:id 3 :complete true} {:id 4})})})))

(with-test
  (def complete-list* 
