Rps

@jsteiner @gabebw
This method is pretty complex and has a lot of magic numbers. I think you could refactor this a bit.