   (seek [this key]
         (.seek iterator key)))
 
+(defn magic-iterator
+  ([tree] (let [itr (iterator tree)]
+            (MagicIteratorWrapper. itr (.key itr) (.-root tree))))
+  ([tree map]
+   (let [itr (MagicIterator. (iterator tree) map (alength map) (array) (array) (.-root tree))]
+     (.set-key itr)
+     itr)))
+
 (defn ->keys [iterators keys len]
   (dotimes [x len]
     (aset keys x (.key (aget iterators x)))))

    (println tree2)
    (println tree3)
    (join #js [itr1 itr2 itr3])
    ))


                (dotimes [x tuple-len]
                  (.push arr false))
                arr)]
    (loop [key start
           i 10]
      (when (and key (> i 0))
        (println "key: " key)
        (when (seek-all iterators len key)
          (->keys iterators keys len)
          (println keys)
          (find-least keys len tuple-len min-fill)
          (println "Min: " min-fill)
          (recur (find-greatest iterators keys len results min-fill) (dec i)))))
    results
    ))

