Add 'grouping' option, close #5