When Mayor Jim Kenney announced his three-cents-per-ounce soda tax in March, it could have been a political slam dunk. During his campaign last year, Kenney built a broad and diverse coalition, and the soda tax was his first crack at governance that relied on that coalition. It seemed a good one: A tax on a non-essential product to pay for pre-K for every child in an education-starved city, that actually had broad popular support. He had educators behind him; he had progressives behind him; he had allies in every corner of the city. On paper, this was lined up to be a huge win for the newly-enshrined mayor.

But the most important skill in governing in Philadelphia isn’t building coalitions that look good in press releases. It’s the ability to count to nine. Without nine of the 17 City Council members behind you, nothing gets done. But Kenney never had nine council members firmly in his corner.

Sure, there were always barriers. The soda industry, naturally, led a full-court press, spending $1.5 million in advertising and robocalls to stop the measure; that was to be expected, though it was surprising to see former Kenney campaign aide Lauren Vidas leading the charge. But the first sign that things were going to be tough for Kenney was 4 weeks ago, when—after weeks of Kenney’s message dominating the news—three members of City Council suddenly came out publicly against the tax, all citing its regressivity. Then Councilwoman Blondell Reynolds-Brown piled on, offering a container-based tax to supersede Kenney’s plan. Finally, last week, Council President Clarke dealt the mortal blow when he said the three-cent tax was a “divisive” non-starter.

To succeed as Mayor, Kenney needs to have a better understanding of how Clarke works. Clarke doesn’t fear losing re-election because he runs unopposed in his district. As the most job-secure Councilman in Philadelphia, once Clarke saw Kenney’s inability to count to nine he knew that a three-cent soda tax wasn’t a threat.

Now, what could have been Kenney’s first big political win as mayor may be his first big political flub. And he has no one to blame but himself and his team, who seemed to have mishandled this from the start.

During his his campaign, Kenney promised to pay for pre-K with the savings that would result from zero-based budgeting. But as we’ve written about before, he barely gave that option lip service after his election, instead going for a watered-down version called “project-based budgeting.” It doesn’t seem like zero-based budgeting was ever fully vetted as an option to pay for pre-K; if it was, the only conclusion is that it either wouldn’t have saved enough money, or that Kenney wasn’t willing to force real cuts on a political class all too accustomed to graft, waste, and excess. Curiously and immediately, he turned to the soda tax—something that he voted against twice when he was in City Council under Mayor Nutter. So either he rushed the entire process, or he never actually planned to use zero-based budgeting to pay for pre-K despite claiming that it could generate $80 million per year in savings during the campaign.

Once he settled on the soda tax as his hill to die on, the amateurish mistakes just kept on coming. First, he and his team were lazy about the actual policy. They did a Ctrl-C job on Nutter’s failed policy (which, again, he voted against twice) and didn’t vet the details themselves. They flubbed the discrepancies between pre-mixed soda and syrup.

But the real embarrassment came when Kenney’s staff was just crushed in basic policy competency by Clarke’s office. Kenney ran the numbers on a one-cent, two-cent, and three-cent per-ounce tax, concluding that the three-cent tax would bring in the most revenue. Clarke’s office, however, was not bound by whole numbers (as Kenney’s staff mysteriously was) and found that a 2.5-cent tax would actually outperform either a two-cent or three-cent tax. The whole thing added up to Kenney’s team being uncritical and uncurious about their own policy ideas.

That brings us to Kenney’s most inexcusable error: His disregard for Clarke. Let’s take a moment to remember that Darrell Clarke was the presumptive Next Mayor of Philadelphia just 18 months ago. But he didn’t even run, because he understood that he’d made himself more powerful as Council President than he could ever be as Mayor, with practically no accountability due to his uncontested council seat. Clarke’s decision not to run is what opened the door for Kenney in the first place.

It doesn’t seem like zero-based budgeting was ever fully vetted as an option to pay for pre-K; if it was, the only conclusion is that it either wouldn’t have saved enough money, or that Kenney wasn’t willing to force real cuts on a political class all too accustomed to graft, waste, and excess.

Kenney’s approach to getting Clarke on board was to (a) toss a few million dollars into one of Clarke’s pet projects, despite the fact that Clarke controls the budget process, and can find $23 million all on his own; and then (b) not communicate with him. On ABC’s Inside Story a couple of weeks ago, host Tamala Edwards asked Kenney how much he’d communicated with Clarke about the soda tax. “I’m not talking directly with Mayor Kenney,” responded Clarke.

How can any mayor of any city expect to pass such a controversial new tax through their city council without even communicating with the Council President? When Ed Rendell was Mayor, he and Council President John Street had a standing meeting every Monday to talk about everything that the Mayor wanted to do. They built a partnership so that they both could succeed. And succeed they did, with the pair helping Philadelphia emerge from one of its darkest hours, and both men quickly becoming elected to even higher offices (the Governor’s Mansion for Rendell and the Mayor’s Office for Street).

Instead of making him a partner in his soda tax efforts, Kenney allowed Clarke to wait and see which way the wind would blow, so he’d come out ahead no matter what. Clarke knew that coming to the defense of a tax against a huge industry lobby (read: campaign donations) was a risk; but so too was appearing to oppose funding for education. Kenney’s tactics gave him the perfect escape route. Clarke waited to see how much support the tax had among voters. If enough were in favor, he would have thrown in with Kenney. Instead, public support has been more or less matched by the industry and unions that oppose the tax, so it’s easy for Clarke to reject it. He’s even using a page out of Kenney’s playbook—rejecting what he says is a “regressive” tax in the name of progressive principles.

To succeed as Mayor, Kenney needs to have a better understanding of how Clarke works. Clarke doesn’t fear losing re-election because he runs unopposed in his district. The only thing he has to fear is getting forced out of his powerful post as Council President. But, as the most job-secure Councilman in Philadelphia, once Clarke saw Kenney’s inability to count to nine he knew that a three-cent soda tax wasn’t a threat.

It seems that Kenney believed that cloaking himself in the armor of an education crusader would make him impervious to assault. He assumed that Clarke would have to fall in line for any policy proposal that found more money for schools, or that he could be bought for a song. But he underestimated the backlash and, incredibly, underestimated Clarke’s political skill.

For all of these missteps, at the end of the day, this could all work out for Kenney. A lesser tax could still pass City Council. And at 1 or 2 cents, it may be where the administration thought they’d end up all along, and all this back and forth we’ve witnessed was just public negotiating. But, if that’s the case, then Kenney’s preference for negotiating this in the media rather than around the same table is perplexing. Even if he does get a 2 cent tax, he’ll have spent enormous amounts of political capital on the project while simultaneously guaranteeing an adversarial relationship with Clarke for the foreseeable future.

Legislation is as much about the journey as it is the destination, because everyone has to walk the same path together time and time again. Kenney’s shortsighted approach may, in the best case, get him to a destination that he wants. But he’s going to have one hell of a time recruiting a copilot for his next trip.