An experimental and theoretical study of reaction mechanisms between nitriles and hydroxylamine