Newly unredacted documents released on Thursday reveal just how in the loop President Trump was as his then-personal lawyer and fixer Michael Cohen tried to keep an alleged affair between Trump and porn star Stormy Daniels under wraps ahead of the 2016 election.

FBI search warrant applications show several phone calls and text messages that appear to link Trump to Cohen’s efforts to pay off Stormy Daniels.

Here are the four key moments:

Cohen was in contact with Trump as Cohen made initial calls to kill Stormy Daniels’ story

Around the same time the Washington Post published video of Trump bragging about assaulting women on the set of NBC’s “Access Hollywood” on Oct. 7, 2016, the FBI alleged, Stormy Daniels was in talks with media outlets to tell her story “about her alleged relationship with Trump.” Michael Cohen also recalled hearing from Daniels’ counsel around this time that news outlets were pursuing the story.

This prompted a flurry of phone calls from Cohen to others in Trump’s orbit, Daniels’ attorney and David Pecker and Dylan Howard, executives at American Media Inc., as he attempted to squash Daniels’ story, the FBI alleged in the newly unredacted documents.

The day after that story was published, Trump allegedly spoke on the phone with Cohen and campaign spokesperson Hope Hicks for over four minutes.

After Cohen made several other calls to Hicks and executives at American Media Inc. — the notoriously pro-Trump media company that allegedly worked with Trump to kill negative stories about him — Cohen and Trump allegedly spoke on the phone for nearly eight minutes.

After hanging up and speaking to AMI executive Howard again, Cohen allegedly received a text message at 9:13 p.m. from that executive, presumably referring to a hush money deal to be brokered with Stormy Daniels’ attorney Keith Davidson: “Keith will do it.”

Cohen spoke with Trump shortly before finalizing payments to Daniels

Later that month on Oct. 26, 2016, the morning after Davidson allegedly warned Cohen that Daniels “deems her settlement agreement canceled and void,” Cohen called Trump at 8:26 a.m. and spoke to him for approximately three minutes, according to the documents. At 8:34 a.m., Cohen allegedly called Trump again and connected for a minute and a half. After getting his accounts in order and letting Davidson know the hush money was ready, Cohen paid Davidson the next morning.

This series of events means Cohen and Trump were in touch at a crucial point: Before the call — and with just weeks before Election Day — there was allegedly a discussion about the risk of Daniels going public with her story.

After his call with Trump, the next morning, Cohen made moves to assure Daniels’ lawyer that the money was on its way.

With the deal done, Cohen and Trump spoke for five minutes

On Oct. 28, 2016, after having finalized the funds transfer to Davidson, Cohen allegedly spoke to Trump for approximately five minutes at 11:48 a.m.

From then on, at least for a few days, it was smooth sailing: “We are very good,” Davidson allegedly texted Cohen, referring to the settlement of the deal.

Later, Cohen allegedly spoke to Hicks again.

Trump allegedly spoke to AMI executive about Karen McDougal story

The smooth sailing didn’t last long. On Nov. 4, 2016, as word spread of an impending Wall Street Journal article on AMI’s payment to kill a story on Trump’s alleged affair with Karen McDougal, Cohen allegedly told AMI’s Howard at 8:58 p.m., presumably referring to Trump: “He’s Pissed.”

Later that night, as Cohen tried to reach AMI’s Pecker, he allegedly asked, “The boss just tried calling you. Are you free?” He also allegedly texted AMI’s Howard, “Is there a way to find David quickly?”

On Nov. 5, the FBI alleged, “Based on a text message from Hicks to Cohen, I believe that later that morning, Pecker spoke to Trump.”

A few days later, Trump became the President-elect.