solution for final exercise 15