chapter 6 exercise 6 and 7 remove types