Completed exercise 5 in HW05.