adjusted algorithm for cucc algorithm, extended testcases for cucc