add groups functionality