changed logic for discounts