doing chapter 5 exercises