* Implemented the graph part of the task