added ability to enable decreasing of threshold over time