added thresholding to standard library