first answer for problem 5