working on user set group size
refactored