Answers and skeleton code for chapter 3