Added grouping - SUCCESS!

Still to do:
* Validate correctness of query