private double evaluatePostfix(MyStack input) {
        MyStack output = new MyStack();
        for (Object o : input) {
            double temp = 0.0;
            output.push(o);
            System.out.println("in:  " + output.toString());
            if (output.peek() instanceof OPERATOR) {
                OPERATOR op = (OPERATOR) output.pop();
                double operand1 = (double) output.pop();
                double operand2 = (double) output.pop();

                switch (op) {
                    case ADD:
                        temp = (operand2 + operand1);
                        break;
                    case SUB:
                        temp = (operand2 - operand1);
                        break;
                    case MULT:
                        temp = (operand2 * operand1);
                        break;
                    case DIV:
                        if (operand1 == 0) temp = Double.NaN;
                        else temp = operand2 / operand1;
                        break;
                }
                output.push(temp);
                System.out.println("out: " + output);
            }
        }
        return (double) output.pop();
    }