I think I preferred how you'd implemented this in the first place.
Is there any advantage to moving this into the `graph.addNode` method?