 (extend-protocol IKeyCompare
   ;; By default, we use the default comparator
   Object
-  (compare [key1 key2] (clojure.core/compare key1 key2)))
+  (compare [key1 key2] (clojure.core/compare key1 key2))
+  Double
+  (compare [^Double key1 key2] (.compareTo key1 key2))
+  Long
+  (compare [^Long key1 key2] (.compareTo key1 key2)))
 
 ;; TODO enforce that there always (= (count children) (inc (count keys)))
 ;;

  (underflow? [this]
    (< (count children) (:data-b cfg)))
  (split-node [this]
    (->Split (data-node cfg (into (sorted-set) (take (:data-b cfg)) children))
             (data-node cfg (into (sorted-set) (drop (:data-b cfg)) children))
             (nth-of-set children (dec (:data-b cfg)))))
  (merge-node [this other]
    (data-node cfg (into children (:children other))))

(defn delete
  [{:keys [cfg] :as tree} key]
  (let [path (lookup-path tree key) ; don't care about the found key or its index
        {:keys [children] :or {children (sorted-set-by compare)}} (peek path)
        updated-data-node (data-node cfg (disj children key))]
    (loop [node updated-data-node
           path (pop path)]
