swap order of flags