divided flock into groups