Combined temperature smoothing code