Oracle on Thursday announced plans to buy a company called Textura for $26 a share or about $663 million, net of Textura’s cash.

Textura sells billing software for the construction industry. Oracle will integrate it into its Primavera software. (Oracle bought Primavera, which makes project management software popular in the construction industry, back in 2008.)

This acquisition is a pretty good deal for all and a very happy ending for Textura and its controversial former CEO cofounder, Patrick Allin.

Both have been on a wild ride since he took the company public in 2013, a hot year for tech IPOs. Shares immediately popped over the $15 IPO price and then soared as high $43.53 in 2013. Then it crashed in 2014, bottoming at $13.93 in February. Shares had been hovering at just below $20 before this news hit.

Textura has never declared a profit. In its last fiscal year, it had reported about $87 in revenue and a net loss of nearly $17 million. It had about $79 million in cash.

Attacked by a famous short

In 2014, Textura and Allin became the target of famous short seller Andrew Left of Citron Research. (Citron and Left will forever be known for taking down Valeant, though he's had plenty of other targets, like Mobileye.)  

In Left's classic style, Citron issued a scathing report on Textura filled with words like "fraud" and "fraudulent." Left took issue with things like how the company was reporting revenue and how it was predicting its profit trajectory.

Citron also called out Allin for not disclosing a previous CEO role he had at a company called Patron Systems a decade ago. Patron's business at the time was based around a proposed deal to buy security company Trustwave, but the purchase never happened, Allin resigned, and Patron went bankrupt a few years later, reports Crain's Chicago Business editor John Pletz.

Left's smoking gun was the letter of resignation from Patron's auditor during Allin's tenure. (It's never a good sign when an auditor resigns.)

Textura vigorously denied all wrongdoing and all accusations from Citron, claiming the report was filled with "inaccurate and misleading statements and gross distortions." 

It's also worth pointing out: the short-selling game is all about betting against the company, turning a profit if the stock stank tanks. 

But the report left marks. A predictable class-action shareholder lawsuit and one of Textura's largest shareholder advising the board to consider selling the company, Pletz reported at the time.

Textura also became the target of an anonymously penned blog, (which is shutting down with the Oracle acquisition), which reported on all things perceived wrong with Textura, including an odd lawsuit by a former employee who claimed Textura unlawfully fired her after she told the company she was pregnant. (Textura denied the charges, according to court documents, but with everything else going on, entered into settlement talks.)

A happy ending

In April 2015, Textura announced that the board had replaced Allin with board member David Habiger who would serve as interim CEO. 

Habiger was known for selling companies as the CEO. He was CEO of Sonic, which sold to Rovi for about $1 billion, and of NDS Group, sold to Cisco for $5 billion.

Allin was moving on to become chairman, the company said at the time. Allin later resigned from the board and left the company at the end of 2015, Textura said in its annual report SEC filing for 2015.

His send-off package included $1.8 million in severance and a bunch of restricted stock units.

This buy is a happy ending for Allin, as he still owned about 8% of the company. With Oracle's $26 a share price, his stake is worth about $58 million.

Textura did not respond to a request for comment and Oracle declined comment.

This story first appeared on Business Insider.