added sort options function