Solving HW 7