          path  empty-path
          level (.-shift set)]
     (if (== 0 level)
-      (path-set path level (lookup-leaf (.-keys node) key))
-      (let [idx (lookup-node (.-keys node) key)]
+      (path-set path level (lookup-insert-leaf (.-keys node) key))
+      (let [idx (lookup-insert-node (.-keys node) key)]
         (recur (aget (.-pointers node) idx)
                (path-set path level idx)
                (- level level-shift))))))

        :else m))
    l))
    
(defn ^number lookup-leaf [^array arr key]
  (binary-search arr 0 (- (alength arr) 1) key))

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

(defn ^number -seek [set key]

                    (LeafNode. (aget ks 1)))))
  
  (lookup [_ key]
    (let [idx (lookup-exact keys key)]
      (when-not (== -1 idx)
        (aget keys idx))))

  (conj [this key]
    (let [idx    (lookup-insert-leaf keys key)
          keys-l (alength keys)]
      (cond
        ;; element already here
        (and (< idx keys-l)
             (eq key (aget keys idx)))
          nil
      
        ;; splitting
        (== keys-l max-len)
          (let [middle (half (inc keys-l))]
            (if (> idx middle)
              ;; new key goes to the second half
