how do molecules behave when heated