Add tests and code