Finish advanced exercise from chapter 3.5