Solutions for chapter 2 exercises