cleaned up flagging