added readRPN function.