add ex4 of chapter 8