Modified for chapter 6.5 Exercises