split function

Divide into Groups