using min max for threshold values now.