Finished insertion sort for arrays.