Created the AdjacencyList and made appropriate changes to the code.