Added functionality to the Graph class