What happens to energy and matter during a chemical reaction?