add the sorting algorithm