Influence of substituents on the thermodynamics and kinetics of ring-closing reactions in organic chemistry