group needs sorted input