Copied chapter 7 to chapter 8.
Improved scope stuff.