added code for REngine/RServe