fully functioning cp.cpp with 4 cmd line arguments