When adding heat to a substance as it melts, the energy is used to _____