Solutions for chapter 8