Expansion and contraction of liquid and gas