finished function of addcpjd