temperature calculation fixed