if index == len(thresholds) - 1:
        index_high = len(thresholds) - 1
    else:
        index_high = index + 1