@Override
    public double evaluate(final String expression) throws ExpressionExecuteException {
        values.clear();
        functions.clear();

        ExpressionTokenizer tokenizer = new SimpleExpressionTokenizer(expression);
        try {
            while (tokenizer.hasNextToken()) {
                String tokenString = tokenizer.getNextToken();
                final Token<?> token = tokenFactory.getToken(tokenString);
                handleToken(token);
            }

            while (!functions.isEmpty()) {
                final Function function = functions.pop();
                function.apply(values);
            }
            return values.peek();
        } catch (FunctionNotDefinedException | NotEnoughParametersException ex) {
            throw new ExpressionExecuteException(expression, ex);
        }
    }