solution for problem 10
solution for problem 11