Working version of C++ lib, need to extend it