r and q could be named more descriptively. Or at least r should be defined somewhere in the Docs.