Completed exercise 4.7