fixed RPN solution