creating a create groups method