Followed the exercises in chapter 5