Editted shponimg.cpp, a C++ variant of shponimg.py