updated the thresholding