Initial chapter 4 and (partial) chapter 5 commit