FBI Director James Comey, who did more to influence the outcome of the 2016 presidential campaign than anyone other than Donald Trump and Hillary Clinton, is back. Investigations are under way into the Trump inner circle’s ties to Russia — and leaks from those investigations are one of several factors in the chaos that has defined Trump’s presidency. As we all wonder what will come next, it’s a good time to take a look at what Comey has wrought.

We now know that at the same time Comey was very publicly lambasting Clinton for her use of a private email server, a much quieter Trump probe was under way as well. I’m not sure there was any single revelation that clued us in to that fact. There have been hints here and there. For instance, Jason Leopold of Vice News reported on Nov. 30 that the FBI had responded to a Freedom of Information Act request with language that suggested an investigation of the Trump-Russia connection was ongoing.

Then, in The New York Times’ blockbuster story of Feb. 14 reporting that top Trump aides had been in touch with Russian intelligence for a year before the election, we learned that the FBI had been looking into former Trump campaign manager Paul Manafort’s ties to Russia since last spring.

So there you have it. Comey very publicly put Clinton through the wringer twice, probably costing her the election. Yet the fact that the FBI and other agencies were investigating the Trump campaign was kept secret, despite plenty of speculation as to why candidate Trump was so deferential toward Russian President Vladimir Putin. (Franklin Foer’s article on Trump and Putin in Slate last July 4, dismissed in some circles as hysterical, is looking remarkably prescient.)

Comey’s actions tell us much about the limits of journalism, too. No, the media did not cover themselves in glory during the campaign. But I would argue that it was Comey, far more than the press, that was responsible for our national obsession with Clinton’s emails at a time when the people around Trump — and possibly Trump himself — may have been involved in much worse.

Consider: Last July, Comey made a highly unusual public announcement that Clinton should not face criminal charges regarding her use of a private email server when she was secretary of state. But Comey went out of his way to blast Clinton, saying she had been “extremely careless.” As the Times put it:

He raised questions about her judgment, contradicted statements she has made about her email practices, said it was possible that hostile foreign governments had gained access to her account, and declared that a person still employed by the government — Mrs. Clinton left the State Department in 2013 — could have faced disciplinary action for doing what she did.

It was the sort of denunciation that made me and a lot of other people sit up and take notice. And though Comey was criticized by a few observers for deviating from the FBI’s policy of not commenting when it decides not to recommend charges, he had a sterling reputation for integrity — earned in 2004 when he intervened on behalf of his seriously ill boss, Attorney General John Ashcroft, who was being pressured to renew the Bush administration’s domestic surveillance program.

Then, of course, Comey put his thumb on the scales just before Election Day, reporting to Congress that he had renewed the email investigation. The details were lurid — supposedly, classified documents may have made their way from Clinton to her top aide, Huma Abedin, to her estranged husband, former congressman Anthony Weiner of sexting infamy.

It turned out there was nothing to it. But the episode constituted an enormous lapse of judgment on Comey’s part, not the media’s. It probably didn’t help that Trump had just hit bottom over the “Apprentice” tape, on which he was heard crudely bragging about sexually assaulting women. The Weiner twist came right at a moment when the media were subjecting Clinton to the tough scrutiny expected of the next president, while Trump was being dismissed as a sideshow.

As for whether the Comey effect actually cost Clinton the election, consider what Sam Wang wrote for the Princeton Election Consortium: “Opinion swung toward Trump by 4 percentage points, and about half of this was a lasting change. This was larger than the victory margin in Michigan, Pennsylvania, Florida, and Wisconsin.” He added: “Comey’s letter appears to have been a critical factor.”

I still think of Comey as a person of integrity. If anything, his problem may be an overweening sense of his own rectitude. His harsh statement in July may have been motivated by a desire to give cover to Attorney General Loretta Lynch following her unfortunate encounter with Bill Clinton. His late hit may have been an attempt to pre-empt rogue agents in the FBI’s New York office who were loyal to Trump sycophant Rudy Giuliani.

But here we are. It is way too early, of course, to know whether Comey will be as consequential in 2017 as he was in 2016. What’s fascinating about this is that just as he dictated the media narrative about Hillary Clinton last year through public pronouncements, now government officials — including, presumably, some who report to Comey — are using anonymous leaks to keep the media in a froth this year.

No one said it was fair. Washington Post columnist Charles Krauthammer, a conservative who is nevertheless no fan of Trump, wrote that former national security adviser Michael Flynn’s leaked lies about his contacts with Sergey Kislyak, the Russian ambassador to the United States, was “a cover-up in the absence of a crime.”

Nevertheless, this is how possible scandals are litigated — through leaks, working up the food chain until it either explodes or fizzles. At a time when President Trump is becoming increasingly unhinged about the media, even going so far as to declare them “the enemy of the American People,” journalists need to resist the urge to push the story past what we know.

As for Comey — well, let’s not forget that he, too, is being investigated, for his handling of the Clinton probe. Such is the state of politics in early 2017.