produces correct answer