Add implementation and unit tests.