found correct answer for problem 2