fixed bugs in cic calculations