Added Flag generation (part 3).