updated and completed exercise 5