Solution for insertion sort part 1