solution to problem 23 added