sorting algorithm done