     (assoc state :ghosts (reverse ghosts) :forest forest)))
 
 (defn- ghost-incr [state poss-fn]
-  (update-ghost-forest state #(ghost/incr %1 %2 poss-fn)))
+  (let [state (update-ghost-forest state #(ghost/incr %1 %2 poss-fn))
+        forest (:forest state)
+        new-nodes (reduce (fn [new-nodes id]
+                            (conj new-nodes (forest/get-node forest id)))
+                          #{} (apply concat (map :active-node-ids (:ghosts state))))]
+    (assoc-in state [:delta-state :add-nodes] new-nodes)))
 
 (defn- rm-old-tails [state]
   (if (>= (:tail-length state) (:frame state)) state
-    (let [node-ids (map :id (forest/roots (:forest state)))]
-      (update-in state [:forest]
-                 #(reduce forest/remove-node % node-ids)))))
+    (let [nodes (forest/roots (:forest state))
+          node-ids (map :id nodes)]
+      (-> state
+          (update-in [:forest] #(reduce forest/remove-node % node-ids))
+          (assoc-in [:delta-state :rm-nodes] nodes)))))
 
 (defn- ghost-set-color [state]
   (update-ghost-forest state (fn [ghost forest]

        scaled-size (map int (scale-fn size))]
    (apply q/ellipse (concat scaled-pos scaled-size))))

(defn- in-line? [& nodes]
  (apply = (map #(apply map - %1)
                (partition 2 1 (map :pos nodes)))))

(defn- draw-node [node active? scale-fn]
  (let [pos (:pos node)
        stroke (get-in node [:meta :color])
        ]

    (q/fill stroke)
    (draw-ellipse pos [1 1] scale-fn)))

(defn- clear-node [node bg-color scale-fn]
  (let [pos (:pos node)]
    (q/stroke bg-color)
    (q/fill bg-color)
    (draw-ellipse pos [1.5 1.5] scale-fn)))

(defn draw-state [state]
  ; Clear the sketch by filling it with light-grey color.
  (q/with-translation window-half-size

    (let [grid-size (:grid-size state)
          scale-fn #(scale grid-size %)
          ]

      (doseq [node (get-in state [:delta-state :rm-nodes])]
        (clear-node node (:background-color state) scale-fn))

      (doseq [node (get-in state [:delta-state :add-nodes])]
        (draw-node node scale-fn))

      ))
  )

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
