def shift(a, b, n):
    """
    a and b are vectors
    n is number of points of a to cut off
    anew and bnew will be the same length.

    """
    anew = a[(list(range(0 + n, len(a)))), :]
    if len(anew) > len(b):
        anew = anew[(list(range(0, len(b)))), :]
        bnew = b
    else:
        bnew = b[(list(range(0, len(anew)))), :]
    return anew, bnew
