Added the processing code and corresponding c++ code.