stack and test code for RPN calculation