added ccd debug mode and fine-tune