added a sorting algorithm