make sure it is bfs