Revert Flawed Change of Loop Logic