                       (set! ix (.-parent-ix node))
                       (set! node (.-parent node))
                       (recur))
-                    (do
-                      (set! end? true)
-                      nil))
-                  #js [(aget (.-keys node) ix) (aget (.-vals node) ix)])))
+                    (set! end? true))
+                  nil)))
             (do
               (set! node (aget (.-children node) (+ ix 1)))
-              (set! ix 0)
-              #js [(aget (.-keys node) ix) (aget (.-vals node) ix)]))))
+              (set! ix 0)))))
   (seek [this key]
         (loop [moved? false]
           (when (false? end?)

(defn apply-to-iterator [iterator movements]
  (for [movement movements]
    (case (nth movement 0)
      :next (vec (.next iterator))
      :seek (vec (.seek iterator (nth movement 1))))))

(defn apply-to-elems [elems movements]
  (let [elems (atom (cons [least nil] elems))]

                            (nil? (.-children node))
                            (let [lower (.-upper (aget (.-children node) ix))]
                              (lt lower key)))
                      nil
                      (do
                        (set! node (aget (.-children node) ix))
                        (set! ix 0)
