finished chapter 4.5.4