Changed adjacency list from Set to dict