first version with tests and docs