calculate temperature better