removed input of numberOfGroups