Final temperature smoothing code