Completed code, unit test and integration test for cg_cpm_eng_cpm