bfs and parameterization