updated class and client for C++ code