replicates the cp program