Added functionality for adding and joining nodes in the graph