add source code and chapter 2 code