final fix for rpn