referenced group_by craziness