   (seek [this key] ;; move the iterator forwards until it reaches a key greater than this one
         ;; head across and upwards until we reach a greater key
         (loop []
-          (if (< ix (alength (.-keys node)))
-            (if (<= key (aget (.-keys node) ix))
-              ;; done
-              nil
-              ;; move along
-              (do
-                (set! ix (+ ix 1))
-                (recur)))
-            (let [parent (.-parent node)]
-              (if (instance? Node parent)
-                ;; jump into parent and start again
-                (do
-                  (set! ix (+ (.-parent-ix node) 1))
-                  (set! node parent)
-                  (recur))
-                ;; end of tree
-                nil))))
+          (when (instance? Node node)
+            (set! ix (.seek node key ix))
+            (when (>= ix (alength (.-keys node)))
+              (set! ix (+ (.-parent-ix node) 1))
+              (set! node (.-parent node))
+              (recur))))
         ;; head downwards and across until we reach the least greater key
         (loop []
-          (if (< ix (alength (.-keys node)))
-            (if (<= key (aget (.-keys node) ix))
-              ;; check for a child
-              (if-let [child (and (.-children node) (> ix 0) (aget (.-children node) (- ix 1)))]
-                ;; jump into child and start again (child cannot be empty if tree is correctly balanced)
-                (do
-                  (set! node child)
-                  (set! ix 0)
-                  (recur))
-                ;; done
-                nil)
-              ;; move along
-              (do
-                (set! ix (+ ix 1))
-                (recur)))
-            ;; end of tree
-            nil))
-        (if (< ix (alength (.-keys node)))
-          #js [(aget (.-keys node) ix) (aget (.-vals node) ix)]
-          nil)))
+          (when (instance? Node node)
+            (when-not (nil? (.-children node))
+              (set! node (aget (.-children node) ix))
+              (set! ix (.seek node key 0))
+              (recur))))
+        ;; if we aren't now at the tree wrapper we can return a result
+        (when (instance? Node node)
+          #js [(aget (.-keys node) ix) (aget (.-vals node) ix)])))
 
 (defn iterator [tree]
   (loop [node (.-root tree)]

            (.assoc! tree i (* 2 i)))
        iterator (iterator tree)]
    (take 2000 (take-while identity (repeatedly #(.next iterator)))))
  )

     (dotimes [i 100000]
       (.assoc! tree i (* 2 i)))))

  (time
   (let [tree (tree 100)]
     (dotimes [i 500000]
       (.assoc! tree i (* 2 i)))))

  (let [tree (tree 3)
        iterator (iterator tree)]
    (take 2000 (take-while identity (repeatedly #(.next iterator)))))
