Nitrogen inversion in cyclic N-chloroamines and N-methylamines