 
 (defn commit-path
   [node path]
-  (loop [node node path path]
-    (if (seq path)
-      (let [[parent i] (peek path)]
-        (recur
-         (->> node (assoc (:children parent) i) (assoc parent :children))
-         (pop path)))
+  (if (seq path)
+    (let [[parent i] (peek path)]
+      (recur
+       (->> node (assoc (:children parent) i) (assoc parent :children))
+       (pop path)))
+    node))
+
+(defn commit-prune
+  [node path]
+  (if (seq path)
+    (let [[parent i] (peek path)]
+      (recur
+       (->> (if (some identity (:children node)) node)
+            (assoc (:children parent) i)
+            (assoc parent :children))
+       (pop path)))
+    (if (every? nil? (:children node))
+      (assoc node :children nil)
       node)))
 
 (defn add-point*

                (add-point* data [])
                (commit-path path))))
        (commit-path (assoc this :data p) path)))))

(def ^{:const true :private true} qt-children [nil nil nil nil])
(def ^{:const true :private true} ot-children [nil nil nil nil nil nil nil nil])

    (let [data (:data this)]
      (if data
        (if (m/delta= data p)
          (or (ffirst path) this)
          (let [n (split-node this)
                [c i] (make-child-for-point n p true)]
            (-> n
