What happens to molecules of a substance as it heats up?