Muammil/nametoflag logic