updated chapter 5 exercise