added solution for problem 8