def binarySearch(sortedList, index):
    """Find the last element of sortedList that has .index <= index"""
    low = 0
    high = len(sortedList)
    while high - low > 1:
        mid = (high + low) // 2
        if sortedList[mid].index > index:
            high = mid
        else:
            low = mid
    return sortedList[low]