refactored temperature converter to make symmetric