update examples in chapter 3 and 4