Moved flag under loop scope & improved comment