start to add groupBy functionality