def calc_cutoffind(freqs, min_tf):
    """
        Using an ordered frequency list (biggest->smallest), identifies index of 
            first item to be cut off.
        
        freqs: ordered frequency list (biggest->smallest)
        min_tf: smallest frequency to accept.
    """
    if min_tf > freqs[0]:
        raise Exception('Cutoff {} is larger than largest frequency {}.'.
            format(min_tf, freqs[0]))
    if min_tf <= freqs[-1]:
        return len(freqs)
    i = 0
    while freqs[i] >= min_tf:
        i += 1
    return i
