added a part of chapter 3