Updated flag encoding