Chapter 7 exercise from Chris Pain book