robust way to remove red flags and green flags