changed to bfs search