everything for Assignment12, (Problem Set 7, part 2)
updated Assignment11 after debugging/testing