Solutions for chapter 3