It took nearly two hours from when President Trump signed his first attempt at a travel ban for the head of United States Customs and Border Protection to get an official version of the president’s executive order.

In the hours that followed, officials scrambled to figure out how to enforce the order and — as protesters, lawyers and politicians swarmed airports — they monitored the demonstrations with detailed granularity, setting up a “Crisis Action Team” to coordinate their response.

As officials begin to roll out President Trump’s latest attempt to severely restrict visitors from certain countries, internal documents provided to The New York Times offer a look at how the government tried to carry out his initial attempt at a travel ban.

The documents, which are dated from Jan. 27 (the day the first executive order was signed) to Feb. 4 (the day after a federal judge temporarily blocked the order from being enforced nationwide), depict an all-night sprint to implement the rules on the fly — a process filled with stops and starts, confusion and lots of conference calls.