adding custom sorting and custom grouping and secondary sorting