Adds group by methods