chapter 6: exercises 7 and 8