private String evaluateCountRBondFunction(final String clause) {
		if (clause == null || clause.equals(""))
			return null;
		if (!(model instanceof MolecularModel))
			return null;
		MolecularModel mm = (MolecularModel) model;
		if (mm.bonds.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;
		}
		String s = clause.substring(i + 1, j);
		double x = parseMathExpression(s);
		if (Double.isNaN(x)) {
			out(ScriptEvent.FAILED, "Cannot parse : " + s);
			return null;
		}
		i = Math.round((float) x);
		if (i < 0 || i >= mm.getNumberOfAtoms()) {
			out(ScriptEvent.FAILED, "Index of atom out of bound : " + i + " in " + clause);
			return null;
		}
		Atom a = mm.atom[i];
		return mm.bonds.getBondedPartnerCount(a) + "";
	}