def insertion_sort(arr):
    """Refresher implementation of inserstion sort - in-place & stable.

    :param arr: List to be sorted.
    :return: Sorted list.
    """
    for i in range(1, len(arr)):
        tmp = arr[i]
        j = i
        # find the position for insertion
        for j in range(i, len(arr)):
            # the position is found if the prev element is smaller than current
            if arr[j - 1] < tmp:
                break
            # shift to the right
            arr[j] = arr[j - 1]
        arr[j] = tmp
    return arr