sorting algorithm completed