to perfect cp functions