private double[] prepareParameters(final Stack<Double> stack) throws NotEnoughParametersException {
            try {
                final double[] parameters = new double[numberOfParams];

                int paramsCounter = numberOfParams;
                while (paramsCounter-- > 0) {
                    parameters[paramsCounter] = stack.pop();
                }
                return parameters;
            } catch (EmptyStackException e) {
                throw new NotEnoughParametersException(functionBody, e);
            }
        }