some headings
move clauses around a bit, test for group by clause