Exercise 7 of ML