added solution to exercise 17.4