fix adjacency list