Added thresholding to measurement