add code for RS