temperature regulation logic