bfs now working