Implement the graph for adjacencyList