void sortSequence() {
		if (size() < 3)
			return;
		Atom[] end = getTermini();
		if (end.length != 2)
			return;
		clear();
		addAtom(end[0]);
		Atom[] at = model.bonds.getBondedPartners(end[0], true);
		boolean b;
		while (at.length == 1 || at.length == 2) {
			b = false;
			if (!contains(at[0])) {
				addAtom(at[0]);
				at = model.bonds.getBondedPartners(at[0], true);
				b = true;
			}
			if (at.length == 2) {
				if (!contains(at[1])) {
					addAtom(at[1]);
					at = model.bonds.getBondedPartners(at[1], true);
					b = true;
				}
			}
			if (!b)
				break;
		}
		model.notifyModelListeners(new ModelEvent(this, ModelEvent.MODEL_CHANGED, null, new Integer(model.molecules
				.indexOf(this))));
	}