public EvaluationResult evaluate(List inputs, EvaluationCtx context) {

        // Evaluate the arguments one by one. As soon as we can return
        // a result, do so. Return  Indeterminate if any argument
        // evaluated is indeterminate.
        Iterator it = inputs.iterator();
        Evaluatable eval = (Evaluatable)(it.next());

        // Evaluate the first argument
        EvaluationResult result = eval.evaluate(context);
        if (result.indeterminate())
            return result;

        // if there were no problems, we know 'n'
        long n = ((IntegerAttribute)(result.getAttributeValue())).getValue();

        // If the number of trues needed is less than zero, report an error.
        if (n < 0)
            return makeProcessingError("First argument to " + getFunctionName()
                                       + " cannot be negative.");

        // If the number of trues needed is zero, return true.
        if (n == 0)
            return EvaluationResult.getTrueInstance();

        // make sure it's possible to find n true values
        long remainingArgs = inputs.size() - 1;
        if (n > remainingArgs)
            return makeProcessingError("not enough arguments to n-of to " +
                                       "find " + n + " true values");

        // loop through the inputs, trying to find at least n trues
        while (remainingArgs >= n) {
            eval = (Evaluatable)(it.next());
            
            // evaluate the next argument
            result = eval.evaluate(context);
            if (result.indeterminate())
                return result;
            
            // get the next value, and see if it's true
            if (((BooleanAttribute)(result.getAttributeValue())).getValue()) {
                // we're one closer to our goal...see if we met it
                if (--n == 0)
                    return EvaluationResult.getTrueInstance();
            }

            // we're still looking, but we've got one fewer arguments
            remainingArgs--;
        }

        // if we got here then we didn't meet our quota
        return EvaluationResult.getFalseInstance();
    }