/// <summary>
        /// Removes rings which do not have all sp2/planar3 aromatic atoms.
        /// and also gets rid of rings that have more than 8 atoms in them.
        /// </summary>
        /// <param name="m">The <see cref="IAtomContainer"/> from which we want to remove rings</param>
        /// <returns>The set of reduced rings</returns>
        private static IRingSet RemoveExtraRings(IAtomContainer m)
        {
            IRingSet rs = Cycles.FindSSSR(m).ToRingSet();

            //remove rings which don't have all aromatic atoms (according to hybridization set by lower case symbols in smiles):
            var rToRemove = new List <int>();

            for (int i = 0; i < rs.Count; i++)
            {
                if (rs[i].Atoms.Count > 8)
                {
                    rToRemove.Add(i);
                }
                else
                {
                    foreach (var a in rs[i].Atoms)
                    {
                        Hybridization h = a.Hybridization;
                        if (h.IsUnset() || !(h == Hybridization.SP2 || h == Hybridization.Planar3))
                        {
                            rToRemove.Add(i);
                            break;
                        }
                    }
                }
            }
            rToRemove.Reverse();
            foreach (var ri in rToRemove)
            {
                rs.RemoveAt(ri);
            }
            return(rs);
        }