All sort algorithm.