solution for problem 10 added