rewrite RPS