First working insertion sort