solution to problem 17 added