bfs is wrong