 
 
 #_(-> (b+tree 3)
-    (t/insert 5 55)
-    (t/insert 9 99)
-    (t/insert 3 33)
-    (t/insert 4 44)
-    (t/insert 2 22)
-    (t/insert 1 11)
-    #_(t/lookup 3))
+    (t/insert [:a 5] 55)
+    (t/insert [:a 9] 99)
+    (t/insert [:a 3] 33)
+    (t/insert [:a 4] 44)
+    (t/insert [:a 2] 22)
+    (t/insert [:a 1] 11)
+    (t/lookup-range [:a 3]))
 
 #_(let [kvs (take 100000 (repeatedly #(let [k (-> (rand-int 9000000)
                                                 (+ 1000000))]

                               (-> (ins this nk n1)
                                   (ins childk n2)))]
        (if (>= (-> nn :size) b)
          (split nn)
          [nn nil nil nlnbs]))))

  B+TreeLookupable

  B+TreeModifyable

  (insert [this k v leaf-neighbours]
    (letfn [(insert-leaf-neighbours [n1]
              (let [{pleaf :prev nleaf :next} (get leaf-neighbours this)
                    {ppleaf :prev}            (when-not (nil? pleaf)
                                                (get leaf-neighbours pleaf))
                    {nnleaf :next}            (when-not (nil? nleaf)
                                                (get leaf-neighbours nleaf))]
                (-> leaf-neighbours
                    (assoc-if-not-nil pleaf {:prev ppleaf :next n1})
                    (dissoc this)
                    (assoc-if-not-nil n1    {:prev pleaf  :next nleaf})
                    (assoc-if-not-nil nleaf {:prev n1     :next nnleaf}))))

            (update-leaf-neighbours [n1 n2]
              (let [{pleaf :prev nleaf :next} (get leaf-neighbours this)
                    {ppleaf :prev}            (when-not (nil? pleaf)
                                                (get leaf-neighbours pleaf))
                    {nnleaf :next}            (when-not (nil? nleaf)
                                                (get leaf-neighbours nleaf))]
                (-> leaf-neighbours
                    (assoc-if-not-nil pleaf {:prev ppleaf :next n1})
                    (dissoc this)
                    (assoc-if-not-nil n1    {:prev pleaf  :next n2})
                    (assoc-if-not-nil n2    {:prev n1     :next nleaf})
                    (assoc-if-not-nil nleaf {:prev n2     :next nnleaf}))))
