Fixing up chapter 5 exercises, and chapter 8