 
   TreeSearch
 
-  (search [this k]
+  (lookup [this k]
     (when-let [child (get children k)]
       (if (satisfies? TreeSearch child)
-        (search child k)
+        (lookup child k)
         child))))
 
 
-(defn b+tree [b]
+#_(defn b+tree [b]
   (->B+TreeNode b 0 (sorted-map) true))

#_(let [kvs (take 100000 (repeatedly #(let [k (-> (rand-int 9000000)
                                                (+ 1000000))]
                                      [k (str "v" k)])))
      t (time (reduce (fn [t [k v]]
                        (insert t k v))
                      (tree 100)
                      kvs))]
  [(first kvs)
   (time (lookup t (-> kvs first first)))])


(defrecord B+TreeNode [b size children leaf?]

  TreeModify

  (add [this k v]
    (letfn [(split [children size]
              (println "SPLIT1" (keys children) (type children))
              (let [partition-size (-> size (/ 2) Math/ceil int)

      (<= (compare k k*) 0) [k* v*]
      true                  (recur ks* vs*))))

#_(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)]
