For centuries, epilepsy was a source of mystery to scientists. Seizures were thought to be caused by everything from masturbation to demonic possession, and it wasn’t until the 1930s that a neurosurgeon showed the condition could sometimes be boiled down to specific spots in the brain. To do it, he had to open up patients’ heads and electrocute their brain tissue—while they were still conscious.

Wilder Penfield, the subject of today’s Google Doodle, was born on January 26, 1891 in Spokane, Washington. According to Vox, the Canadian-American doctor revolutionized the way we think about and treat epilepsy when he pioneered the Montreal Procedure. The operation required him to remove portions of the skulls of epilepsy sufferers to access their brains. He believed seizures were connected to small areas of brain tissue that were somehow damaged, and by removing the affected regions he could cure the epilepsy. His theory was based on the fact that people with epilepsy often experience “auras” before a seizure: vivid recollections of random scents, tastes, or thoughts.

To pinpoint the damaged brain tissue, he would have to locate the part of the brain tied to his patient’s aura. This meant that the patient would need to be awake to tell him when he struck upon the right sensation. Penfield stimulated the exposed brain tissue with an electrode, causing the patient to either feel numbness in certain limbs, experience certain smells, or recall certain memories depending on what part of the brain he touched. A local anesthetic reduced pain in the head; shocking the brain didn’t cause any pain because the organ doesn’t contain pain receptors.

During one of his surgeries, a patient famously cried, “I smell burnt toast!” That was the same scent that visited her before each seizure, and after Penfield removed the part of her brain associated with the sensation, her epilepsy went away.

Brain surgery isn’t a cure-all for every type of epilepsy, but treatments similar to the one Penfield developed are still used today. In some cases, as much as half of the brain is removed with positive results.

[h/t Vox]