Restructured chapters - adding some chapter 9 code