as a liquid is heated and changed into a gas what happens to molecules