finish sorting algorithms