bfs is now working