Correctness of the Cycle-Canceling Algorithm