Completed exercise 5.2