bfs returns path, not list of visited nodes