def isort(a):
    "Sort list a using insertion sort"
    for i in range(1, len(a)):
        move_left(a,i)

def move_left(a, j):
    "isort helper function that moves a[j]"
    x = a.pop(j)
    while j > 0 and a[j-1] > x:
        j -= 1
    a.insert(j, x)

