changed coupon function