renamed MIN_TEMP to INVALID_TEMP