added sort_phrase