Changed parameter from 'numGroups' to 'groups'.