In August 2014, Sarah Fortune was trying to tag bowhead whales with transmitters so she could study their feeding habits in Canada’s Cumberland Sound, where many of the large sea mammals spend their summers.

But the whales kept swimming into a small, shallow bay with large boulders, where at least one removed a transmitter by rubbing against the rocks. “The whales were just rolling onto their sides, lifting their flippers out of the water, doing headstands, lifting their tails out of the water,” she said. The behavior was puzzling.

Though she didn’t know it at the time, the mystery of the rock-rubbing whales dates back at least 170 years. Around 1845, whalers started calling bowheads “rock-nosed whales” after seeing them rub their heads on boulders. Several subsequent papers have also noted the behavior, usually concluding the whales were using the rocks to rest.