Fixed graph implementation (now depth-first search should work *much* faster)