Clarified spec.
Add tests to cover each aspect of spec.