More tweaking on discount problem. Added console.log for output