modify the sentence to remove the grammatical problems:
The idea of refrigeration was built based on the principle that when a liquid changes to a gas, it absorbs heat as it expands in a self contained cycle, the air or other fluid surrounding the device can be reduced in temperature.
The idea of refrigeration is built based on the principle that when liquid changes to gas, it absorbs heat as it expands in a self-contained cycle, and air or other fluid surrounding the device can be reduced in temperature.