flagSort[data_List] := Sort[data, (#1 === RED || #2 === BLUE) &]