finished the discount logic and squashed bugs