insertion sort with memory block moving