Ants didn’t take over the world by being stupid and cowardly. Case in point: Rafts of fire ants have been spotted floating around floodwaters in Houston, Texas, colonies banding together to weather super-storm Harvey.

If your first thought was Please, no, you’re human, and that’s fine. Fire ants are an invasive species―they arrived in Texas in the 1950s to menace crops and native species alike. And floods like this have a habit of spreading the ants around even faster than their legs can carry them. But if you can, put aside for a moment your terror at the prospect of self-assembling arks of stinging ants and dive into this fascinating manifestation of problem solving in social insects.

Fire ants make their home in the ground, which makes the insects extremely vulnerable to flooding. But should they detect something awry, the workers start linking together using hooks on their limbs. They form into a ball with the vulnerable members of the colony—eggs and larvae and the queen—bundled up in the center.

“They use the wax together on their bodies to keep the queen and other members of the colony in the middle of the ball dry so they don't suffocate,” says Mike Merchant, entomology specialist at the Texas A&M AgriLife Extension Service. And submerged workers from time to time shift above the water line so they don’t drown. (The species evolved in the Amazon, so this clever rafting adaptation allowed them to survive periodic flooding.)

They’ll float like this until they hit something dry―a log or rock or, heaven forbid, your home. “The unfortunate thing is they don't care what it is that's dry,” says Wizzie Brown, extension program specialist also at the Texas A&M AgriLife Extension Service. “So if it's a house that they hit and there are people on the roof stranded, they will go up there as well because that's them trying to escape the flood waters.”

If you’re wading around flood waters and run into a raft of 100,000 fire ants, your day will get considerably more complicated. The ants will board you and sting and not let go, even if you submerge. (Stings are painful, hence the name, but rarely fatal, typically if you’ve got an allergy to the venom.) Really, your best bet is to hit their rafts with soapy water, which breaks up the ants’ waxy covering and drowns them. Otherwise, it’s hard to stop these things, which have been known to float around for almost two weeks.

But should the raft make it to a dry surface, the ants form into an even more bizarre structure: a roiling, liquid Eiffel Tower. The workers start climbing, up a branch or what have you, while other ants stay at the base to support the weight. “It's just like a chocolate fountain running in slow motion in reverse,” says engineer Craig Tovey of Georgia Tech. “Go up the sides and down the middle, and they just keep doing that.”

The construction job isn’t exactly efficient. “It's almost a trial and error thing,” Tovey adds. “If part of the tower is too tall and skinny, it collapses, it sort of peels off. And what you're left with is the part that's stable, the part that shaped kind of like the Eiffel Tower.” Which is fine, because it doesn’t need to be as consistently solid as the raft. The ants are just buying time as they set up a new colony.

But why now? Why are fire ant rafts floating around Texas, when the species has invaded a good chunk of the southern US? Where were they during Katrina?

Well, they were dead. Katrina’s surge came very hard and very fast, so the fire ants all drowned before they could form rafts. Harvey has been terrible, but its slower onset gave the ants time to detect the onslaught and make their escape.

So, dear Texans, stay dry and stay vigilant. And maybe start carrying dish soap.