Solutions for chapter 5