Temperature function added