chapter 4 revised + code