Added support for thresholds