updated thresholding