big refactor: all tests pass; assignments still lightly awkward