parameterizable rr generation and bug fixes