solution to problem 29 added