Added functionality for clearing graph.