Added implementation of graph.