Why is this loop done twice? And, IMO, it shouldn't provide output for the "OK" case, as we don't care.