Finished iterative insertion sort