added support for GROUP BY clauses