,add code for advance R