Finished problem 2 of HW7