Exercise 4 (R)