updated ccd function to float