Update to CCD function