new coupon code system, and lots of bugfixes