Updated chapter 5 exercise