added groups function