add logging for thresholding