completed discount calculator and tests