preliminary group function