solved exercise 19.2