implement grouping of tabular results