public void removeMarkedParticles(List<Integer> list) {
		if (selectedComponent != null) {
			selectedComponent.setSelected(false);
			selectedComponent = null;
		}
		if (gbBufferArray == null)
			gbBufferArray = new GayBerneParticle[MesoModel.getMaximumNumberOfParticles()];
		int temp = 0, temq = 0, ii = 0;
		for (int i = 0; i < nParticle; i++) {
			if (!list.contains(i)) {
				int nMeasure = gb[i].getNumberOfMeasurements();
				if (nMeasure > 0) {
					Object measure;
					for (int nm = 0; nm < nMeasure; nm++) {
						measure = gb[i].getMeasurement(nm);
						if (measure instanceof Integer && list.contains(measure)) {
							gb[i].removeMeasurement(nm);
						}
					}
				}
				if (gbBufferArray[temp] == null) {
					gbBufferArray[temp] = new GayBerneParticle();
					gbBufferArray[temp].setModel(model);
					gbBufferArray[temp].setIndex(temp);
				}
				gbBufferArray[temp].set(gb[i]);
				gbBufferArray[temp].setSelected(gb[i].isSelected());
				gbBufferArray[temp].setUserField(gb[i].getUserField());
				List<Layered> l = getLayeredComponentHostedBy(gb[i]);
				if (l != null) {
					for (Layered c : l)
						c.setHost(gbBufferArray[temp]);
				}
				// map the old indices of the surviving particles to the new ones
				// liveParticleMap.put(i, new Integer(temp));
				temp++;
			} else {
				if (!layerBasket.isEmpty()) {
					List<Layered> l = getLayeredComponentHostedBy(gb[i]);
					if (l != null) {
						for (Layered c : l) {
							c.setHost(null);
							layerBasket.remove(c);
						}
					}
				}
				ii = gb.length - 1 - temq;
				if (gbBufferArray[ii] == null) {
					gbBufferArray[ii] = new GayBerneParticle();
					gbBufferArray[ii].setModel(model);
					gbBufferArray[ii].setIndex(ii);
				}
				gbBufferArray[ii].set(gb[i]);
				gbBufferArray[ii].setUserField(gb[i].getUserField());
				gb[i].eraseProperties();
				temq++;
			}
		}
		for (int i = temp; i < nParticle; i++)
			gb[i].erase();
		nParticle = temp;
		for (int i = 0; i < nParticle; i++) {
			gb[i].set(gbBufferArray[i]);
			gb[i].setSelected(gbBufferArray[i].isSelected());
			gb[i].setUserField(gbBufferArray[i].getUserField());
			if (!layerBasket.isEmpty()) {
				List<Layered> l = getLayeredComponentHostedBy(gbBufferArray[i]);
				if (l != null) {
					for (Layered c : l)
						c.setHost(gb[i]);
				}
			}
		}
		model.setNumberOfParticles(nParticle);
	}