put the above together, and only do if no group by is there