completed depth first search
BFS took an additional 2 hours