Finished HW07 exercise 2.