A substance on heating undergoes (i) a rise in its temperature, (ii) A change in its phase without change in its temperature. In each case, state the change in energy of molecules of the substance.