added another potential thresholding algorithm