solve exercise 20.38 - 20.39