Completed exercise 5 of X.6