add the merged group function