this is the first time I've seen `outFlag`.  Why not init to `0` so that's more obvious? (plus, then you don't have to clear only certain bits here).