Updated temperature calculation