About six years ago three college fraternity guys founded an app to make sexting consequence free. That app was, of course, Snapchat. This week, Snap, Inc. filed for its IPO with a $25 billion valuation. The company is expected to raise $3 billion with the IPO. However, only two founders are listed on the IPO documents. How the third one was shut out and the amount of money they had to pay him to go away is as sordid a tale as the reason the app exists in the first place.

Snap Inc.'s IPO documents brought a bunch of behind the scenes drama from the app's early days to light. One of the most interesting aspects of Evan Spiegel and Bobby Murphy's company is the exclusion of the third founder. He was a Stanford student who reportedly came up with the concept for the app, designed its distinctive ghost logo, and helped find and hire Snapchat's current CEO. And yet, this person is absent from the company today.

Reggie Brown came up with the idea for a sexting app in the summer of 2011 and shared it with his friend Evan Spiegel. They realized pretty quickly that the idea was going to be a very, very big deal. They brought in a third friend, Bobby Murphy, to code the app. All was well. The friends were excited. And then Brown overhead Spiegel and Murphy plotting to cut him out of their business. But Brown had ammo. He had possession of Snapchat's patent documents. And he was not going to hand them over without a fight.

TIMOTHY A. CLARY/AFP/Getty Images

Spiegel and Murphy (pictured above) had to pay Brown to go away. And that didn't come cheap as Brown sued Snapchat for his share of the company. Snap Inc. settled with Brown for $158 million. According to the IPO, this money was to be sent in a series of payments. The last one, in the amount of $107.5 million was paid in 2016.

The IPO's documents revealed the settlement's financial terms and timeline:

"In February 2013, an individual filed an action against us, our predecessor entity and two of our officers in Los Angeles Superior Court, alleging that we were using certain intellectual property that the individual jointly owned with our founders.

In September 2014, the parties entered into a settlement agreement that resolved all claims among the parties. Under the agreement, we agreed to pay the individual a total of $157.5 million and such amounts were recorded in 2014. We paid the individual $50.0 million in 2014. As of December 31, 2015, $107.5 million was included in accrued expenses and other current liabilities on the consolidated balance sheet. We paid the individual $107.5 million in the year ended December 31, 2016.

There are no further amounts required to be paid in the future."

But how did it all turn so sour? How did two friends end up plotting against the third? How did Spiegel and Murphy end up paying Brown a bigger settlement than Mark Zuckerberg paid the Winklevoss twins?

Evan Spiegel and Reggie Brown met in the dorms at Stanford. They were brothers in the Kappa Sigma fraternity. Brown was an English major, Spiegel was studying product design. The entire idea for Snapchat evolved from a simple wish to make sexting easier. The friends thought if photos could disappear after they were sent, then there would be less fallout from sexting. The idea originated with Brown and Spiegel. The pair recruited Bobby Murphy, who could code later. Spiegel had previously worked with Murphy on a failed project called Future Freshmen. This is an important fact in the unraveling of the Snapchat trio.

In the summer of 2011, Spiegel, Murphy, and Brown were working out of Spiegel's dad's house near the beach in Santa Monica. They were hard at work on a new app for the iPhone. Everyone they shared their idea with thought it was amazing. They had success and dollar signs in their eyes. And with good cause, just six years later, the company that that app spawned has a valuation of $25 billion.

As the three worked diligently to bring Snapchat to life, they took on the roles best suited to them. Spiegel was the CEO. Murphy, the CTO. Brown was the chief marketing officer. Brown assumed they were equal partners with one-third interest each.

One of the first projects Brown worked on was the logo. He claims that he was the one who came up with the idea of the ghost called "Ghostface Chillah," that remains Snapchat's logo today. Brown also claims to have written the terms of service, privacy policy, FAQ, marketing materials, and the description of the app for iTunes. He also came up with the name of the company that would own Snapchat. He called it the "Toyopa Group" after the name of the street the Santa Monica beach house they were living in was located on.

The app went live on iTunes' App Store on July 8, 2011. The three young men were stoked that their app was a hit. Naturally, they planned a party. They celebrated the birth of their company with a cake emblazoned with the Snapchat logo and candles. They took a photo of the event. Brown, Murphy, and Spiegel stood behind the cake with their arms around each other.

A bit more than a month later, the friendship and business partnership Brown had with Spiegel and Murphy would be over. It happened that quickly. And that photo of the three young men standing behind the cake with their arms around each other celebrating the launch of Snapchat became a critical piece of the evidence in Brown's lawsuit. He was there from the beginning.

Spiegel wanted to get a patent application filed quickly, before anyone else could steal the idea. Brown was planning to go to law school, so he was tasked with this chore.

On August 11, 2011 Brown filed a patent application with the U.S. Patent and Trademark Office listing all three of them as equal co-creators of the app.

However, Brown was missing a critical bit of information. Back in June, when Spiegel set out to form the entity that would own Snapchat, Brown assumed it was a new company and the three of them were equal partners. That wasn't the case. Spiegel merely changed the name of the entity he and Murphy set up when they were trying to launch Future Freshman. Brown wasn't listed as a partner at all.

Brown testified that when the Toyopa Group papers were drawn up, he simply assumed he owned a third of the company. The three men were, after all, its only employees and they all lived together in the same house, working on the same project.

As the summer wore on tensions mounted between Brown and his partners. Brown became paranoid and started eavesdropping on conversations Spiegel and Murphy had about him. That's when he discovered that his friends were planning to oust him from the company.

There was just one problem. Remember, the idea for Snapchat was Reggie Brown's idea.

It all hit the fan on August 16th. Spiegel, Murphy, and Brown were on a conference call. They had been drinking. Spiegel wanted to know why Brown had not given him a copy of the patent filing. Brown wanted to know what his equity stake in Snapchat was.

Brown said he was willing to take the smallest part of a 20/40/40 split. Spiegel and Murphy did not agree. Instead, they immediately changed the passwords on Snapchat's server and user accounts, locking Brown out.

They reached a détente. Brown was suspicious because of his knowledge that Spiegel and Murphy wanted him out. Spiegel and Murphy were suspicious because Brown wouldn't hand over the patent filing.

Look, Brown made a good argument that he was one of the three founders. He came up with the idea, its logo, the name of the company, and filed for its patent. He was not, however, involved in the actual building of the app. He was not involved in the coding, the engineering, or the development of the app.

It goes without saying that his work was critical to the birth of Snapchat. Of the three founders, only Brown had the knowledge and skill set to do that patent application. While Brown was working on that, Spiegel and Murphy were building the app and making sure it worked. Brown's work was crucial support, but it wasn't the same as what Spiegel and Murphy were doing. This is a familiar tension in tech. Those who build the products see themselves as omnipotent, but the truth is, they wouldn't get far without the Reggie Browns of the world. Companies do not survive without people who make sure all the pieces are working together and get the patents filed before their competition.

Spiegel and Murphy argued that Brown was a hanger-on who exaggerated his role at Snapchat and deserved nothing.

The lawsuit between Reggie Brown and his former friends dragged on for a year and a half. Multiple attempts were made at settlement.

Snapchat is worth $25 billion. It is one of the fastest growing tech companies in history. It had $405 million in revenues in 2016 and is expected to go public in early March. Evan Spiegel and Bobby Murphy will become richer than they could have ever dreamed.

Reggie Brown will be at home, cooling his jets, with his $158 million settlement.

Amy Lamare is a Los Angeles based writer covering business, technology, entertainment, philanthropy, and pop culture. She spent 8 1/2 years covering the entertainment industry for www.hsx.com. She attended the University of Southern California where she majored in Creative Writing. An avid long distance runner, weekends she can be found running the streets of Los Angeles training for 1/2 and full marathons. Follow her on Facebook.