prototype better thresholding2