implemented CID and completed TODO