regenerated for better bfs path