reinstored a correct version of the getNbGroup() function