new flag function