def indexMatch(l, v):
    """Returns the index of v in sorted list l or -1.
    This uses Jon Bentley's binary search algorithm.
    This uses operators > and <."""
    i = 0
    j = len(l) - 1
    while i <= j:
        m = i + (j - i) // 2
        if l[m] < v:
            i = m + 1
        elif l[m] > v:
            j = m - 1
        else:
            return m
    return -1
