Added additional functionality to the graph.py module