Threshold function for pip