Completed Exercise 3 of ML