resolved HW3 part 2