slightly optimized cc