cp.cpp modofied