def putBitsIntoList_1(n, L):
    """Takes an integer and puts L of it's least sig bits into a list"""
    binstr = bin(n)[2:]
    ret = [0]*L
    for i in range(L):
        try:
            ret[i] = int(binstr[-i-1])
        except IndexError:
            pass
    return ret