Working functions, final exercise 2