C++ code for initial verification