The merger between US Airways and American Airlines is almost complete, but for those who thought the merger only happened due to American's parent company, AMR Crop. filing for bankruptcy, according to papers filed Monday by the two companies, that is not the case at all.

"US Airways began studying a potential merger with American Airlines several months before American filed for bankruptcy protection in late 2011," the statement from both airlines claimed.

In fact, the documents give step-by-step details on exactly how the merger was negotiated, including the issues of how to share ownership of the merged company and who would run it.

Current US Airways CEO Doug Parker, who will run the combined company, played up the importance of Monday's filings with the bankruptcy court in New York and the U.S. Securities and Exchange Commission.

"With these materials filed, we are one step closer to completing the merger, which we expect to occur in the third quarter of this year," US Airways officials said a memo to employees, reported USA Today.

However, there are still problems that need to be solved, one of those is redoing the severance package for the outgoing American CEO Tom Horton.

The issue is that the agreed deal of $20M, which includes stock options, was rejected by federal judge Sean Lane, under grounds that it violated a 2005 bankruptcy law.

According to The Dallas Morning News, "the decision isn't expected to sidetrack the merger, but it will force the companies and the unsecured creditors committee to revisit what compensation it can give Horton, who will step down as CEO and become non-executive chairman of the merged companies."

AMR, American and various subsidiaries filed for bankruptcy protection on Nov. 29, 2011 and even though airline officials were reorganizing AMR's finances including deep cost-cutting in labor and other areas, US Airways chairman and CEO Doug Parker led an effort to have the two carriers merge and thanks to an $11 billion offer, the takeover is assumed to be completed in the next couple of weeks.