solution to problem 21 added