Solved exercise 2 of week 7 though without adjacency list