revised several examples. Added chapter 9.