Just hours before a U.S.-set deadline, the U.S. and Canada reached an agreement on a rewrite of the North American Free Trade Agreement.

The preliminary deal, reached Sunday, added Canada to a trilateral trade agreement to replace NAFTA, dubbed the US-Mexico-Canada Agreement. President Donald Trump announced a preliminary agreement with Mexico more than a month ago.

Kansas legislators applauded the agreement, including U.S. Rep. Roger Marshall who served as a negotiator for the deal several months ago in Mexico City.

“I’m not happy, I’m ecstatic,” Marshall said of the deal. “Kansas has over 100,000 NAFTA-reliant jobs, and we export almost three to four times more to Canada or Mexico than to China.”

The USMCA gained the U.S. greater access to Canada’s dairy markets by eliminating a pricing system that made it harder for U.S. dairy farmers to enter the market, as well as raising quotas on how much U.S. dairy can come into Canada.

Marshall said this was one of the biggest wins for Kansas in the new agreement.

“A couple years ago, Canada began charging an increased tariff on powdered milk, and they were able to dump powdered milk on the world market,” he said. “A shipment from the dairy plant in Garden City arrived in Kansas City to head to China and was canceled. China canceled it because Canada was dumping powdered milk on the world market. This agreement put an end to that.”

Canada will still impose tariffs on U.S. dairy products exceeding the quota, but changes should give U.S. dairy farmers more access to Canada and other foreign markets.

Marshall said other wins for Kansas include eliminating a wheat grading system that prevented U.S. wheat from entering Canada, as well as aerospace manufacturing being able to move between Canada and Mexico duty-free.

The deal also raised the percentage of automobiles that must be made in North America in order to enter the U.S. duty-free and raised the bar for respect of U.S. intellectual property, Marshall said.

Canada originally pulled away from negotiations but reached an agreement leading up to a midnight deadline Sunday. Marshall said the U.S. had set the deadline to finalize its agreement with Mexico before the new Mexican administration takes over.

“We would have moved forward with just Mexico,” Marshall said. “NAFTA started as a bilateral agreement with Canada and then Mexico joined. This is a four-dimensional game of chess; it’s not checkers.”

The agreement will still have to pass a vote in Congress, as well as be approved by the Canadian and Mexican governments.