An idyllic dip in the ocean off the coast of Massachusetts turned into an actual nightmare for 61-year-old William Lytton earlier this month. Without warning, a massive shark thought to be a great white snatched Lytton in its powerful jaws, and his quick thinking is probably the only reason he’s alive today.

There’s plenty of advice out there about what to do if you ever find yourself on the wrong end of an aggressive shark, but it’s hard to know what might actually save your life. In the past, some wildlife buffs have advised shark attack victims to punch the shark in the tip of the nose to stun or startle it, but that’s not what worked for Lytton. Instead, Boston Magazine reports that he send a flurry of fists at the creature’s gills.

“I initially was terrified, but, really, there was no time to think,’’ Lytton told reporters. “‘It doesn’t feel like I did anything heroic. A lot of this was luck.”

Luck is probably a good way to describe surviving a shark attack, but Lytton didn’t just lay back and pray that the animal would release its grasp. He says he repeatedly pounded his fists against the side of the shark, likely striking it in its gills, and kept doing so until it decided to abort its attack.

He managed to make it back to the beach and was brought to a local hospital by helicopter for treatment. The Boston Globe reports that he’s already endured six surgeries with another on the horizon. He was initially placed in a medically-induced coma while doctors repaired his body for two days.

The shark, which hasn’t been conclusively identified as a great white by scientists, did Lytton a favor by missing some important nerves when it chomped down. Nevertheless, his recovery will take some time, and he’s not planning on hitting the ocean waves any time soon.