Adding chapter 1 and 2 example code