Fixed partitioning bfs (hopefully)

Fixed partitioning bfs (hopefully)