refactor evalRPN