Exercise 21.1 (different functions tested)