-implemented a ThresholdChecker so there is more control over how to calculate the threshold value.
-thresholdChecker in example