tried to make changes to discover all paths in bfs fasion would not work