exercise 6 solution