change insertion sort implementation to count number of shifts