edited cp.cpp to match the one I sent to my partner