What happens to the molecules of a substance as heat is added?