updated stack and rpn