more fleshing out. tests pass.