Final version of chapter 7,8,9