added functionality for the graph object