Implementing the graph