rdiscount rewrite