public static void removeElectronContainer(ISetOfAtomContainers set_Renamed, IElectronContainer electrons)
 {
     IAtomContainer[] acs = set_Renamed.AtomContainers;
     for (int i = 0; i < acs.Length; i++)
     {
         IAtomContainer container = acs[i];
         if (container.contains(electrons))
         {
             container.removeElectronContainer(electrons);
             IMolecule[] molecules = ConnectivityChecker.partitionIntoMolecules(container).Molecules;
             if (molecules.Length > 1)
             {
                 set_Renamed.removeAtomContainer(container);
                 for (int k = 0; k < molecules.Length; k++)
                 {
                     set_Renamed.addAtomContainer(molecules[k]);
                 }
             }
             return;
         }
     }
 }
 public static void removeAtomAndConnectedElectronContainers(ISetOfAtomContainers set_Renamed, IAtom atom)
 {
     IAtomContainer[] acs = set_Renamed.AtomContainers;
     for (int i = 0; i < acs.Length; i++)
     {
         IAtomContainer container = acs[i];
         if (container.contains(atom))
         {
             container.removeAtomAndConnectedElectronContainers(atom);
             IMolecule[] molecules = ConnectivityChecker.partitionIntoMolecules(container).Molecules;
             if (molecules.Length > 1)
             {
                 set_Renamed.removeAtomContainer(container);
                 for (int k = 0; k < molecules.Length; k++)
                 {
                     set_Renamed.addAtomContainer(molecules[k]);
                 }
             }
             return;
         }
     }
 }