Completed sort loop