add unit tests
cpp version is ready