Completed exercise 12-6