exercise 18 completed, functions