Updated CCD function and header file