/// <summary>
        /// inserts the given atom into the atom type index
        /// </summary>
        private void UpdateIndexAtomType(atom a)
        {
            int type = a.GetAtomTypeInt32();

            // add any new lists if needed
            for (int i = index_atom_type.Count; i <= type; i++)
                index_atom_type.Add(new ArrayList());

            ArrayList typelist = (ArrayList)index_atom_type[type];
            typelist.Add(a);
        }
 /// <summary>
 /// removes an atom from the atom type index
 /// </summary>
 private void RemoveFromAtomTypeIndex(atom a)
 {
     int type = a.GetAtomTypeInt32();
     ArrayList typelist = (ArrayList)index_atom_type[type];
     typelist.Remove(a);  // warning: this is slow compared to RemoveAt
 }