private FloatQueue computeQueue(String expression, byte averageFlag) {
		FloatQueue q = new FloatQueue(model.getTapeLength());
		if (expression.startsWith("\""))
			expression = expression.substring(1);
		if (expression.endsWith("\""))
			expression = expression.substring(0, expression.length() - 1);
		q.setName(expression);
		String str = useSystemVariables(expression);
		float result = 0;
		float sum = 0;
		String s = null;
		int n = model.getTapePointer();
		for (int k = 0; k < n; k++) {
			s = useParticleVariables(str, k);
			s = useMoleculeVariables(s, k);
			double x = parseMathExpression(s);
			if (Double.isNaN(x))
				return null;
			result = (float) x;
			if (averageFlag == 1) {
				sum = k == 0 ? result : 0.05f * result + 0.95f * sum;
				q.update(sum);
			} else if (averageFlag == 2) {
				sum += result;
				q.update(sum / (k + 1));
			} else {
				q.update(result);
			}
		}
		return q;
	}