Insertion sort tidied up