add group-by to print