Modified Insertion Sort