Added Exercise 4 in full