debugged the C++ error, and further reorganizing