changed discounts logic