Tag - insertion sort algorithm