It’s been nearly a year since the Trump Administration issued its first Muslim ban, unleashing chaos at airports across the country. A new report provides some details about why that chaos unfolded the way it did.

Last week, the Department of Homeland Security’s inspector general issued a long-delayed review of the agency’s implementation of the first Muslim ban. Despite redactions and a delay in the report’s release of more than three months by DHS, this report still confirms an alarming lack of guidance, preparation, and information given to government officers that weekend. It also shows that Customs and Border Protection, the agency tasked with implementing the ban, repeatedly violated court orders as they were issued in the week following the announcement of the ban. Similar conclusions have emerged from FOIA documents released to ACLU affiliates that filed 13 separate lawsuits seeking information on the ban’s implementation from CBP offices across the country.

The report evaluates DHS’s response from January 27 through February 3 — the first week following the executive order, which banned nationals from seven Muslim-majority countries and refugees from entering the United States. The very first sentence underscores the total absence of preparation by Customs and Border Protection, the agency responsible for screening travelers at airports: “CBP was caught by surprise when the President issued the EO on January 27, 2017.” The report continues:

“[N]o policies, procedures, and guidance to the field were developed. Nevertheless, the EO took effect immediately, while travelers from the affected countries were in the air and thousands more were preparing to travel.”

The lack of communication and planning stemmed from the top-echelons of the Trump administration. Then-DHS Secretary John Kelly reported that he “believed” he saw a draft of the order three days before it was publicly issued and then again the day before. Joseph Maher, the acting general counsel for DHS, told investigators that “he lacked specific knowledge of the EO (but did know generally that an EO was coming) until he saw a draft about an hour before it was signed.” The investigation concluded that no one else at DHS headquarters saw a draft of the order.

Despite being the agency responsible for implementation, CBP received most of its information from officials outside the Trump administration — namely congressional staffers “who were apparently better informed about the parameters of the EO than CBP itself.” Foreseeably, this lack of information required DHS, the Department of Justice, and the State Department “to improvise policies and procedures in real time.”

Failures in planning and communications aside, the report found DHS in direct violation of two court orders, Louhghalam v. Trump issued on Jan. 29 in a challenge brought by the ACLU of Massachusetts and local attorneys, and Mohammad v. United States on Jan 31, which prohibited the government from implementing the ban. However, CBP issued instructions — coupled with threats — to airlines not to board certain passengers. On Jan 31, days after the Louhghalam court order, an Iranian visa-holder was denied boarding to her flight and “a Swiss Air representative told her that CBP had recommended that she not be permitted to board the flight to Boston.” Swiss Air’s legal department later confirmed that CBP warned them of “the potential for fines up to $50,000 and refusal of permission for the flight to land.”

It’s clear that as the court orders started to roll in late on Saturday, January 28, and for days and months to come, the government searched for workarounds to continue to stop individuals from these Muslim-majority countries from coming to America. It’s difficult to tally the damage caused to people who were detained at airports and prevented from boarding planes, let alone the impacted people who we don’t know about. CBP forced individuals arriving from the banned countries to make an impossible Hobson’s choice: withdraw their application and leave the country “voluntarily” or be placed in expedited removal proceedings and potentially be banned from the United States for years.

Alongside this lack of internal information-sharing, failures of leadership, and violations of court orders, it is also worth remembering the compassionate actions of many. The Port of Seattle delayed a flight departure for approximately an hour — waiting for a court decision on behalf of a Sudanese and a Yemeni national on the flight. Both individuals were able to enter the United States as a result. A Watch Commander, a CBP supervisor, at Dulles prevented a Turkish Airlines flight — which was already on the tarmac — from departing in order to allow an impacted individual to disembark and enter the United States once a court order was issued. Officers nationwide used their own money to purchase food or beverages for those detained. Lufthansa disregarded CBP’s “no board” instructions and threats and flew passengers into Logan Airport. All the while, thousands of protesters gathered outside of airports nationwide shouting, “Let them in.”

In contrast, this administration has demonstrated that it will leave its employees in the lurch; violate court orders; and delay, redact, and dispute an oversight report. But, as the OIG report stated, “no Department of Government is free to circumvent court orders, even when they are exceptionally difficult to enforce.” If only the administration agreed.