Doing the last exercise of chapter 6