Completed matrix insertion sort