Exercise 3 modified