Code from C++ clas