def METHOD_NAME(stiffness, value, minAA=20, AA='all'):
    """Returns minimum or maximum value of sping constant from 
    mechanical stiffness calculations for residues that are within 
    more than ``min_aa`` from each other. ``Value`` should be 'minK'
    or 'maxK'. It alow to avoid residues near each other. 
    ``AA`` is a number of residues from both terminus (N and C)
    of protein strcuture, it can be ``all`` or int value (than first 
    and last ``AA`` residues will be analysed. 
    With ``minAA=0`` it can be used to search the highest/lowest 
    values of interactions between N-C terminus if protein structure
    has a shear, zipper or SD1-disconnected mechanical clamp 
    -it is common in FnIII/Ig like domains and determines the maximum 
    unfolding force in AFM or SMD method."""
    if AA == 'all':
        sm = stiffness
    elif isinstance(AA, Integral):
        sm = stiffness[0: AA, (-1)*AA-1:-1]
    minK = np.min(sm[np.nonzero(sm)]) 
    maxK = np.amax(sm)
    if value == 'minK':
        indices = np.where(sm == minK)
    elif value == 'maxK':
        indices = np.where(sm == maxK)
    try:
        residue_diff = abs(indices[0][0]-indices[0][1])
    except: 
        residue_diff = abs(indices[0]-indices[1])
    sm_mod = sm.copy()
    checking = True
    while checking:
        if residue_diff < minAA:
            sm_mod[indices[0][0],indices[0][1]] = 0
            sm_mod[indices[1][0],indices[1][1]] = 0
            if value == 'minK':
                mK = np.min(sm_mod[np.nonzero(sm_mod)])
                indices = np.where(sm_mod == np.min(sm_mod[np.nonzero(sm_mod)]))
            elif value == 'maxK':
                mK = np.amax(sm_mod)
                indices = np.where(sm_mod == np.amax(sm_mod))
            try:
                residue_diff = abs(indices[0][0]-indices[0][1])
            except: residue_diff = abs(indices[0]-indices[1])
        else: 
            if value == 'minK':
                mK = np.min(sm_mod[np.nonzero(sm_mod)])
                indices = np.where(sm_mod == np.min(sm_mod[np.nonzero(sm_mod)]))
            elif value == 'maxK':
                mK = np.amax(sm_mod)
                indices = np.where(sm_mod == np.amax(sm_mod))
            checking = False
    if len(indices[0]) == 2:
        return mK, list(indices[0])
    return mK, list(indices[0])+list(indices[1])