Implement exercise 7