       (<= (compare k k*) 0) [k* v*]
       true                  (recur ks* vs*))))
 
-(defn- inode-split [{:keys [ks vs size] :as n}]
+(defn- inode-split [{:keys [b ks vs size] :as n}]
   (let [partition-size  (-> size (/ 2) Math/ceil int)
         [ks1 ks2]       (partition-all partition-size ks)
         [ks1 nk]        [(butlast ks1) (last ks1)]
         [vs1 vs2a vs2b] (partition-all partition-size vs)
         vs2             (concat vs2a vs2b)]
     #_(println "ISPLIT")
-    [(internal-node ks1 vs1 (dec partition-size))
+    [(internal-node b ks1 vs1 (dec partition-size))
      nk
-     (internal-node ks2 vs2 (- partition-size (rem size 2)))]))
-
-(defn- inode-ins [{:keys [ks vs size] :as n} k v]
+     (internal-node b ks2 vs2 (- partition-size (rem size 2)))]))
+
+(defn- inode-ins [{:keys [b ks vs size] :as n} k v]
   (if-not (= k ::inf)
     (let [[ks1 ks2] (split-with #(< (compare % k) 0) ks)
           [vs1 vs2] (split-at (count ks1) vs)


(declare insert*)

(defn- internal-node [ks vs size]
  {:pre [(= (count vs)
            (inc (count ks)))]}
  {:type :internal
   :ks ks
   :vs vs
   :size size})

      (recur (lookup* v k))
      v)))

(defn tree [b]
  (leaf-node b))


#_(-> (tree 3)
    (insert 5 55)
    (insert 9 99)
    (insert 3 33)
