added groups functionality