commit to lab partner - updated cp.cpp fully working

I have updated the cp program so it could match all the requirements from lab