seperated grouping and sorting #3291