fixing ct algo