Finished HW07 exercise 3.