Remove print statements from group function