Exercise 3 fix and Exercise 4 solution