made functions and calculate temperature differece