Completes exercise 6