Added code and tests.