replaced magic number 100 by numGroups