Added chapter 2 and chapter 4 examples