added the code for adjacency list