Added THERMAL mode and necessaryfunctio