do get groups function