function to check answer
function to check answer