Code and tests.