solution to problem 9 added