Implemented scanning_threshold_positive function