solve exercise 3.23