   (-next-path (.-root set) path (.-shift set)))
 
 
-(deftype BTSetIter [^BTSet  set
-                    ^number path
-                    ^array  keys
-                    ^number idx]
+(deftype BTSetIter [set path keys idx]
   ISeqable
   (-seq [this]
     (when keys this))

      idx
      -1)))

(defn ^number lookup-range [^array arr key]
  (let [arr-l (alength arr)
        idx   (binary-search arr 0 (dec arr-l) key)]
    (if (== idx arr-l)
      -1
      idx)))

(defn ^number lookup-insert-leaf [^array arr key]
  (binary-search arr 0 (- (alength arr) 1) key))

(defn ^number lookup-insert-node [^array arr key]
  (binary-search arr 0 (- (alength arr) 2) key))

(defn ^number -seek [set key]
  (loop [node  (.-root set)
         path  empty-path
         level (.-shift set)]

        (let [new-keys (splice keys idx (inc idx) #js [])]
          (rotate (LeafNode. new-keys) root? left right))))))

(defn keys-for [set path]
  (loop [level (.-shift set)
         node  (.-root set)]
    (if (pos? level)
