     (let [new-children (assoc children index new-child)]
       [(->RootNode keys new-children)]))
   (insert [node index new-child1 median new-child2]
-    ;(println "root recieving split children")
-    (let [new-children (vec (concat (take index children)
-                                    [new-child1 new-child2]
-                                    (drop (inc index) children)))
-          ;;TODO find a better datastructure than vector
-          ;;use the vector with lg time split/merge
-          new-keys (vec (concat (take index keys)
-                                [median]
-                                (drop index keys)))]
-      ;(println "new keys:" new-keys)
-      (if (>= (count new-children) (* 2 b))
-        (let [split-med (nth new-keys (dec b))
-              left-index (->IndexNode (vec (take (dec b) new-keys))
-                                      (vec (take b new-children)))
-              right-index (->IndexNode (vec (drop b new-keys))
-                                       (vec (drop b new-children)))
-              median (nth new-keys (dec b))]
-          [left-index median right-index])
-        [(->RootNode new-keys
-                     new-children)])))
+    (handle-multi-insert ->RootNode node index new-child1 median new-child2))
   INodeLookup
   (lookup [root key]
     (scan-children-array keys key)))

    (let [new-children (assoc children index new-child)]
      [(->IndexNode keys new-children)]))
  (insert [node index new-child1 median new-child2]
    (let [new-children (vec (concat (take index children)
                                    [new-child1 new-child2]
                                    (drop (inc index) children)))
          ;;TODO find a better datastructure than vector
          ;;use the vector with lg time split/merge
          new-keys (vec (concat (take index keys)
                                [median]
                                (drop index keys)))]
      (if (>= (count new-children) (* 2 b))
        (let [split-med (nth new-keys (dec b))
              left-index (->IndexNode (vec (take (dec b) new-keys))
                                      (vec (take b new-children)))
              right-index (->IndexNode (vec (drop b new-keys))
                                       (vec (drop b new-children)))
              median (nth new-keys (dec b))]
          [left-index median right-index])
        [(->IndexNode new-keys
                      new-children)])))
  INodeLookup
  (lookup [root key]
    (scan-children-array keys key)))

      ;; Special case for insert into empty tree, since we can't compute paths yet
      (->RootNode [] [(->DataNode [new-key])]))))

(defn delete-key
  [tree key]
  (let [path (lookup-path tree key)])
  )

(defn empty-b-tree
  []
  (->RootNode [] [(->DataNode [])]))
