Completed HW08 exercise 2.