My solution for an insertion sort algorithm