Updated to match part 2 of HW3