private String evaluateNearestMoleculeFunction(final String clause) {
		if (clause == null || clause.equals(""))
			return null;
		if (!(model instanceof MolecularModel))
			return null;
		MolecularModel mm = (MolecularModel) model;
		if (mm.molecules.isEmpty())
			return null;
		int i = clause.indexOf("(");
		int j = clause.lastIndexOf(")");
		if (i == -1 || j == -1) {
			out(ScriptEvent.FAILED, "function must be enclosed within parenthesis: " + clause);
			return null;
		}
		int nom = mm.molecules.size();
		String s = clause.substring(i + 1, j);
		String[] t = s.split(",");
		int n = t.length;
		switch (n) {
		case 3:
			float[] x = parseArray(3, t);
			if (x != null) {
				for (int k = 0; k < x.length; k++)
					x[k] *= IR_CONVERTER;
				x[2] *= x[2];
				double dmin = Double.MAX_VALUE;
				int imin = -1;
				double r = 0;
				Molecule m = null;
				for (int k = 0; k < nom; k++) {
					m = mm.molecules.get(k);
					Point2D p = m.getCenterOfMass2D();
					r = distanceSquare(p.getX() - x[0], p.getY() - x[1]);
					if (r < x[2] && r < dmin) {
						dmin = r;
						imin = k;
					}
				}
				return "" + imin;
			}
			break;
		default:
			out(ScriptEvent.FAILED, "argument error: " + clause);
			return null;
		}
		return null;
	}