Sort the array.