Extract ascending sort function for reuse