change bfs generator