added bfs ()