Enable optimizing the ams by thresholding