Moved the stack into the RPN method so that it gets instantiated each time. This way there will always be a new stack when using RPN.