removes rdiscount and fixes bugs