Final exercises for chapter 6