flag story begin function