   when creating helper (p, q, and r) nodes. In particular, helper nodes don't require
   character group processing or bookkeeping metadata"
   (let [node-num (count (-> graph :layers (get layer-id) :nodes))
-        node-id (keyword (s/join "-" [layer-id node-num]))]
-    (map->Node (assoc input :id node-id :layer-id layer-id))))
+        node-id (keyword (s/join "-" [layer-id node-num]))
+        node (map->Node (assoc input :id node-id :layer-id layer-id))
+        g (update-in graph [:layers layer-id :nodes] conj node)]
+    [g node]))
 
 
 (defn- add-p-q-nodes [graph last-node node characters]

  (let [proto-node {:characters characters}
        p-layer-id (inc (:layer-id last-node))
        q-layer-id (dec (:layer-id node))
        p-node (make-node graph p-layer-id proto-node)
        q-node (make-node graph q-layer-id proto-node)
        g (-> graph
              (update-in [:layers p-layer-id :nodes] conj p-node)
              (update-in [:layers q-layer-id :nodes] conj q-node)
              (update-in [:ps] conj p-node)
              (update-in [:qs] conj q-node)
              (add-edge last-node p-node characters)

  In that case, the r node is placed in the intervening layer, and an edge is created
  from last-node to r node"
  (let [r-layer-id (inc (:layer-id last-node))
        [r-g r-node] (make-node graph r-layer-id {:characters characters})
        g (-> r-g
              (update-in [:rs] conj r-node)
              (add-edge last-node r-node characters))]
    [g r-node]))
