Cross-linking in polypyrrole and poly(N-methylpyrrole): Comparative experimental and theoretical studies