use unsigned int for ct/ci