does solid give out or take in energy when it melts?