fixed the function so it would display the answer correctly