Solved 5d. End of chapter 5.