@SuppressWarnings("unchecked")
	void removeAtoms(BitSet bs) {
		if (bs == null)
			return;
		int m = atomCount - bs.cardinality();
		if (removedAtomList == null)
			removedAtomList = new ArrayList(bs.cardinality());
		else removedAtomList.clear();
		if (keptAtomList == null)
			keptAtomList = new ArrayList(m);
		else keptAtomList.clear();
		for (int i = 0; i < atomCount; i++) {
			if (bs.get(i)) {
				removedAtomList.add(atoms[i]);
			}
			else {
				keptAtomList.add(atoms[i]);
			}
			atoms[i] = null;
		}
		int n = keptAtomList.size();
		for (int i = 0; i < n; i++) {
			atoms[i] = (Atom) keptAtomList.get(i);
			atoms[i].atomIndex = i;
		}
		m = removedAtomList.size();
		for (int i = 0; i < m; i++) {
			atoms[n + i] = (Atom) removedAtomList.get(i);
		}
		atomCount = n;
	}