The U.K. journalist Miles Kington quipped that knowledge is knowing a tomato is a fruit; wisdom is knowing not to put one in a fruit salad. It wasn’t always this way. Decades of commercial growing have altered the tomato’s genetic makeup, turning it from a once-sweet fruit into today’s relatively tasteless sandwich topper. Now, a new study has uncovered which flavor-enhancing genes have been lost, giving growers a “roadmap” to breed tastiness back into their tomatoes.

“This is great work, which I believe could only be done by very few groups on Earth,” says Changbin Chen, a horticultural scientist at the University of Minnesota in St. Paul, who wasn’t involved with the study. “This is doable for commercial growers who supply the fresh tomato market.”

Tomatoes are among the highest-value crops in the world. In the United States—the world’s second largest tomato grower behind China—they account for more than a billion dollars in sales annually. Nutritionally, they are important sources of vitamins A and C. But the large, plump, ruddy tomatoes available year-round in grocery stores taste much different than the small, multihued, berry-sized fruits that evolved more than 50 million years ago near Antarctica and were first domesticated in Central and South America some 2500 years ago. The fruits spread throughout the world following Spanish colonization in the 16th century. Over the next 400 years or so, hundreds of regional cultivars of tomatoes emerged, but they mostly stayed small, sweet, and flavorful.

Then, commercial agriculture exploded after World War II, and tomato crops were bred for higher yields, disease resistance, redder color, and firmness, explains Harry Klee, a horticultural scientist at the University of Florida in Gainesville and one of the study’s authors. These traits helped growers sell their crops for more money, but growers neglected genes responsible for taste, Klee says, and many of these were lost or tamped down over thousands of generations.

To try to bring the taste of bland commercial tomatoes closer to that of their more appetizing ancestors, Klee and an international team of horticultural researchers set out to decode exactly what has changed in the tomato genome. They sequenced the genomes of 398 tomato varieties including commercially grown versions as well as wild, ancestral tomatoes and heirloom tomatoes—older, motley strains that are “light-years away from market tomatoes in terms of taste,” Klee says. Over the next few years, the scientists assembled dozens of consumer panels and conducted taste tests with 101 university-grown tomato varieties, including both heirlooms and commercially grown fruits, recording which ones people liked most.

Then the researchers used a technique known as gas chromatography to vaporize the tomato samples and sort out their molecules, resulting in a list of chemicals and their concentrations within each sample. They zeroed in on chemical compounds known as volatiles that are released as we chew and trigger a response in the olfactory system, contributing to overall taste sensation. Comparing the consumer panels’ tomato preferences to their chemical profiles, the team came up with a list of 13 chemical compounds strongly linked to likability.

Going back to the tomato genome, the researchers identified specific genes responsible for the presence of these volatiles, as well as which heirloom varieties carried those genes, they report today in Science . Klee says that by crossbreeding commercial tomato crops with these heirloom varieties over multiple generations, growers could, step-by-step, produce a tomato that’s large, plump, red, and disease resistant—but that also tastes pretty good. This process would likely only take a few years, he says.

Chen agrees that this would very likely lead to tastier mass-market tomatoes, but cautions that modifying these genes might mean slightly shorter shelf lives for the fruit.

The researchers also identified genes that control sugar content, but realistically, there’s no way to directly boost the sugar in commercially grown tomatoes, Klee says. That’s because agricultural economics strongly favors high-yield plants, and the higher a plant’s yield, the less sugar it can invest in each tomato. But the right mix of volatiles can give the perception of sweetness without sacrificing fruit size or yield. These modified tomatoes still might not belong in a fruit salad, but your sandwich will taste better.