debugged flagging