 
   B+TreeModifyable
 
-  (insert [this k v]
-    (letfn [(split [{:keys [b m size] :as n}]
+  (insert [this k v leaf-neighbours]
+    (letfn [(insert-leaf-neighbours [n n1]
+              (let [{pleaf :prev nleaf :next} (get leaf-neighbours n)
+                    {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})
+                    (assoc-if-not-nil n1    {:prev pleaf  :next nleaf})
+                    (assoc-if-not-nil nleaf {:prev n1     :next nnleaf}))))
+
+            (update-leaf-neighbours [n n1 n2]
+              (let [{pleaf :prev nleaf :next} (get leaf-neighbours n)
+                    {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})
+                    (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}))))
+
+            (split [{:keys [b m size] :as n}]
               (let [partition-size (-> size (/ 2) Math/ceil int)
                     [ks1 ks2] (partition-all partition-size (keys m))
                     m1 (apply dissoc m ks2)

      (let [nn (ins this k v)]
        (if (>= (-> nn :size) b)
          (split nn)
          [nn]))))

  B+TreeLookupable




(defprotocol B+TreeModifyable
  (insert [this k v leaf-neighbours]))

(defprotocol B+TreeLookupable
  (lookup [this k])
