Chapter 6 exercise 3 with clarifications