add groups to data