Angina — severe chest pain due to lack of blood (and therefore oxygen) in the heart muscle — effects over 6 million Americans. Treated primarily with nitroglycerin for decades, the market for improvements in its treatment has long since been ripe for innovation.

In the late 1980s, drug manufacturer Pfizer had a theory: could blocking an enzyme called PDE5 expand the blood vessels to the heart, thereby treating angina? Their researchers took up the task and in the early 1990s, discovered a PDE5 inhibitor which they dubbed UK-92480. Over the course of testing, the research team discovered that the effect of the drug wasn’t quite strong enough, and, when the they upped the dosage, participants’ chest pains were reduced but general muscle pain increased. Over time, and after a series of iterations, the team decided that UK-92480 was not going to be an effective angina treatment.

Like all drug trials, lots of side effects pop up — in this case, more than just chest pains. In one study, some male participants were reporting an increased number of erections a few days after taking the pill; but the research team ignored the issue. As one researcher put it, in writing off the side effect as a positive, “I remember thinking that even if it did work, who would want to take a drug on a Wednesday to get an erection on a Saturday?

But as the odds of UK-92480 being useful toward angina waned, coincidentally, so increased the notion that erectile dysfunction was a legitimate medical issue. The research team turns their attention toward ED, and a few years later, UK-92480 bore fruit: Viagra — a drug which, from 1999-2001, totaled $1 billion in annual sales, and billions more since. For Pfizer, a happy, and profitable, accident.

For angina sufferers? No such luck. Angina is still treated, primarily, with nitroglycerin; Viagra doesn’t help. In fact, it makes it worse; those who take nitroglycerin cannot simultaneously take Viagra without risking a dangerous drop in blood pressure.

Bonus fact : It’s not uncommon for one drug to be used to treat multiple disorders. In 1992, Merck released Proscar, a daily pill consisting of 5mg of finasteride, to treat enlarged prostates. Five years later, Merck released Propecia, a daily pill consisting of 1mg of finasteride, to treat male pattern baldness. A year’s supply of Propecia costs roughly $700, so some men — seeking to re-grow hair — instead buy a pill splitter and Proscar, as the same amount of milligrams costs less than half as much.

Related: “The Rise of Viagra: How the Little Blue Pill Changed Sex in America” by Meika Loe.