BFS simplified.