valid insertion sort implementation