The first loop compares all elements until a discrepancy is found and should then break out of the loop sop that a second can take over, which will not compare any fiurther since the change has been marked anyway.