make use of adjacency list (2d vector)