Implement grouping. Resolve #83