added invert to rpn