finished part 4 of HW6