cleaned up smoothed temperature code; added/improved comments