corrected iteration error on adjacency list