Adding implementation for first graph.