eliminated globals, improved debug, added name/main test in rpn