Add tests, documentation