Flagging trap loop by TomGoulooze

Required.