Tweaked addEdge so it works, but is still missing a test case