Fixed errors and included comments for the console.log of the dicount problem.