added chapters 2 and partially finished chapter 3