Created logic that makes a temperature calculation