added RS implementation