revise rsm, main program