Improved Thermal and added test with MATLAB.