touched up cp.cpp so that it accepts flags