In last summer’s blockbuster hit Captain America: Civil War, the Avengers fractured when the Marvel heroes failed to agree on superheroic accountability. Iron Man wanted the team kept in check by the law; Captain America thought the safest hands were their own. But both agreed: Things go wrong when you try to save the world.

A new study, published Friday in the journal Expert Systems with Applications, suggests the Avengers were right: Sometimes, heroism really can kill.

The authors of the paper were trying to identify the best survival strategy in life-or-death disaster situations. While we’ve grown accustomed to praising people who act selflessly to save others, University of Waterloo civil engineering Ph.D. candidate Eishiro Higo, who led the study, considered the opposite: Could our heroes, both fictional and real, actually be doing harm?

To test the ups and downs of epic rescues, he and his team created a computer model of a three-story Kyoto subway station, filled with adults and elderly citizens minding their own business. Then, the scientists set loose a virtual flood — and watched how their humans reacted. In one simulations, the humans did the kind of thing you see in movies: They got right into formation and stuck together, battling the flood as a group. In another scenario, everyone acted selfishly and saved themselves, leaving those who couldn’t escape to die. But in a third scenario, the strongest members got themselves to safety first — and then tried to save everyone else.

Surprisingly, it was the last scenario that had the most survivors. When the strongest members of the group got themselves to safety and then came back to help the vulnerable (in this case, by lowering a rope), seven more lives were saved than in the other scenarios. Higo explained that this occurs because true heroism comes down to determining “what is brave and what is reckless.”

If you’ve ever been on a plane, you already know this is true. During the requisite safety debrief, flight attendants remind passengers that they should always put their own oxygen mask on first if the cabin suddenly loses pressure. It may feel right — and righteous — to put your child’s mask on before your own, but science says the choice would doom you both. In all likelihood, you’d pass out before your kid’s mask was actually on, and because they won’t be able to put yours on for you, you’d both die from asphyxiation.

The same thinking, applied to the Avengers, could have saved them and the people they were rescuing a lot of grief. For all the good they supposedly do, the heroes are thought to have caused $160 billion dollars in damage to Manhattan in their 2012 midtown melee alone, and in the process they probably killed a few people, too.

So the next time you’re caught in a subway rapidly filling with water or a plane suddenly losing air, be less like Tony Stark and a little more like Captain America. Because look, buddy, this isn’t about your ego. It’s about saving as many lives as possible — including your own.

Photos via Flickr / marvelousRoland