def neighbors(start, finish):
    """
    returns the neighbors in finish from start
    assumes both are sorted
    """
    assert finish
    index = 0
    retval = []
    for x in start:
        if x < finish[0]:
            retval.append((None, 0))
            continue
        if x > finish[-1]:
            retval.append((len(finish) - 1, None))
            continue
        try:
            while True:
                if x < finish[index] or x > finish[index + 1]:
                    index += 1
                    continue
                else:
                    break
            retval.append((index, index + 1))
        except IndexError:
            retval.append((len(finish) - 2, len(finish) - 1))
    return retval
