to check for the correct result, given code for exam