multistep BFS