San Diego–When the game is running for president, there is more than one way to win.

When running for president, you can win in the conventional sense by raising lots of money, beating the competition, getting the most votes, and finishing in first place. Or you can fail to get traction and drop out but still “win” by raising issues, shaping the debate, conducting yourself with dignity, and inspiring supporters to the point where they won’t back anyone else.

If you wind up in the second camp, you can still live to fight another day. You can make another bid for the White House again in a few years, or land on a short list to be named the eventual nominee’s running mate, or even retire from politics altogether with a stronger brand and national name recognition. The point is to not make enemies, make a fool of yourself, or make supporters sorry they backed you. If you avoid those mistakes, losing need not be fatal.

This should offer some comfort to Julian Castro, who this week ended his nearly yearlong quest for the White House after months of trying to get the media, the pollsters, and the voters to give him something they all seemed intent on denying him at every turn: respect.

Castro broke the news of his departure in a video message.

“I’ve determined that it simply isn’t our time,” he said. “Today it’s with a heavy heart, and profound gratitude, that I will suspend my campaign for president.”

Declaring that he would continue to “fight” for issues he cared about–which seem centered around the idea of championing the downtrodden and the dispossessed, and forcing Democrats to act like Democrats–Castro didn’t say which of his former opponents he planned to endorse for president, if anyone.

That part wasn’t surprising. The former secretary of Housing and Urban Development has been critical of many of the other Democratic hopefuls. At a time when many people are saying that Democrats have moved too far to the left, it’s difficult to find any presidential contender who is to the left of Castro.

At one point, a few months ago, there were more than two dozen people seeking the Democratic nomination for president and the chance to lock horns with Donald Trump in the general election in November. This means that, when all was said and done, and the debates were over, and the ad buys complete, there would be only one winner and at least 24 also-rans.

I always assumed that Castro, my friend of nearly 20 years, was likely to wind up among the latter. The odds were against him.

Don’t misunderstand. This was no reflection on Castro’s talent or political skill. He’s a smart guy, and he has a firm grasp on a number of issues. He does his homework, and puts in the miles when meeting voters. He is a quick study and strong debater. What he lacks in charisma, he makes up for in competence.

It’s just that I knew that, in order to get into the winner’s circle, Castro would have to defeat billionaires, governors, senators and a former vice president of the United States. He would also have to lead in the polls, get the media on his side, and raise more than $100 million. That’s a tall order.

And as if all these tasks weren’t daunting enough, Castro would have to accomplish all this despite being born the wrong color. As a Latino, Castro is stuck in the racial in-between. He is neither black nor white. So naturally, the Democratic National Committee, the Democratic Party, Democratic voters in early states, and a Democrat-friendly media didn’t know what to do with him, where to put him or where he fit into the national color scheme.

And as a Mexican-American, Castro had to overcome the additional obstacle of being part of a subset that–while making up about two-thirds of Latinos–resides mostly in the Southwest. Mexican-American cities like Phoenix, Dallas, and Los Angeles are far away from the media capitals of New York and Washington, D.C. Go to those two cities, and you’ll see that the level of ignorance about Mexican-Americans is profound.

For instance, in the first few months of the campaign, Castro was often asked by white reporters why he didn’t speak fluent Spanish. He had to repeat a rehearsed explanation about how, 60 or 70 years ago, our parents were discriminated against and picked on for speaking Spanish, and thus they had decided to raise their children with an emphasis on speaking English. Most Mexican-Americans know this story by heart, and very few of them seemed to care much about Castro’s level of Spanish proficiency. Why should they? The majority of Latinos speak English or a combination of English and Spanish. Yet the questions kept coming because the people asking them weren’t Latino.

Later, when he suggested that the only way to repair President Trump’s border crisis was to decriminalize unauthorized border crossings, media pundits rushed to the conclusion that he must be in favor of an “open border” with Mexico. Castro had to push back against that assertion as well by pointing out that what he was calling for wasn’t all that radical. Under current law, entering the United States without permission may be handled as either a civil or criminal offense though, most often, it’s the former. Still, it’s no stretch to assume that the reason some were so quick to tag Castro as wanting to open the flood gates on our southern border is because he is Mexican-American.

I’ve been there. Years ago, a sweet old woman–and regular reader of my column–wrote an angry email that accused me of wanting an open border so I could “bring in (my) relatives.” I’m sure white columnists get that all the time.

You know who noticed the shabby way in which Castro’s presidential bid was covered? Castro. In an interview last February, shortly after he entered the race, he told me that he had just lectured the editors of a prominent Washington, D.C.-based digital media site about the need to hire more Latino journalists to cover politics. I doubt they listened. After 30 years in this business, I know this much: We are much better at giving directives than we are at taking them.

Still, when it comes to achieving diversity in media, Castro was onto something. With less than a year until votes are cast in the general election, think about where we’ve arrived. The Pew Research Center recently found that Latinos will, for the first time ever, represent the largest racial or ethnic minority group among voters. The 32 million eligible Latino voters will make up just over 13 percent of the electorate–more than African-Americans. And the contest for the Democratic nomination has lost its only Latino combatant.

As the first readily-identifiable Mexican-American candidate to get this far, Castro’s White House bid was full of significance from the start. He wore many hats. He was the teacher, reminding Democrats that–in between holding fundraisers in wine caves–it’s acceptable to visit homeless encampments. He was the reformer, bravely telling audiences in Iowa that it only right to let more diverse states vote first. He was the conscience, hollering about police violence against people of color and calling out the victims by name. He was the workhorse, visiting small towns and hearing the stories of the people who live there. Finally, he was the dreamer, fueled by the idealistic belief that government could help improve the lives of the governed.

So, it’s appropriate that Castro’s exit from the race would also be about something bigger than just coming up short. For much of the campaign, he struggled to get beyond 2 percent in the polls and tried to get the media’s attention. Now that he has left, it says a lot about the unwillingness of allegedly progressive white voters in early voting states to support the most progressive candidate in the race. His departure also doesn’t speak well for the Democratic National Committee, which seems to be achieving what it preferred all along: a simple choice in a narrow field of white candidates who can’t be accused of dabbling in identity politics. Finally, the fact that Castro is out doesn’t reflect well on the media, which never gave him a chance or the credit he deserved.

I’ll give my friend credit. He entered the ring, threw punches and took a few himself. He didn’t change his positions from one season to another, moving from the left to the right and back to the center. He kept his dignity and, for the most part, he kept his cool. He made his mark. And he showed the country that a Mexican-American can compete for the highest office in the land.

This is a rough game. Not everyone gets a trophy. But make no mistake. Julian Castro has a lot to be proud of. This is what “winning” looks like.