Fifty hours. That’s how long it now takes to decode and interpret a newborn baby’s genome — an undertaking that used to take weeks, or even months. And those two days can mean the difference between life and death for a critically ill infant.

In a paper published in the journal Science Translational Medicine, researchers led by Stephen Kingsmore, director of the Center for Pediatric Genomic Medicine at Children’s Mercy Hospital, describe a new genetic test that can rapidly screen the DNA of babies in the neonatal intensive care unit (NICU) for about 3,500 diseases known to be linked to single-gene mutations. Of these, doctors can treat about 500.

Up to a third of babies admitted to the NICU have a genetic disease. But many newborns are not diagnosed properly and may therefore miss the opportunity for a potentially life-saving therapy. Many of the symptoms of such genetic diseases are both general and shared by many different conditions, which makes them difficult to diagnose; what’s more, many of the genetic conditions in question are rare, so most physicians, even NICU specialists, may not be familiar them or unable to recognize their symptoms. Currently used genetic tests are also too expensive and time-consuming to be clinically useful; because the tests can take weeks, or sometimes months, most NICU babies will have either gone home or died by the time the results are ready.

So Kingsmore and his colleagues collaborated with Illumina, a manufacturer of gene-sequencing machines, to shorten the time it takes to both decode an entire genome and generate a clinically useful analysis of that sequencing. Thanks to recent advances in the ability to break up and re-knit DNA, the company was able to sequence the 3 billion base pairs of the genome in just 27 hours — down from weeks.

But decoding a genome is only half of the challenge. Words in a book don’t make sense unless they are put together in a grammatically sensible way, and similarly, DNA is meaningless unless it’s analyzed in the context of genes, which in turn are connected to human functions or conditions. So for two years, Kingsmore’s team worked on special software designed to help doctors use genetic information to make accurate diagnoses and guide ill babies to the right treatment.

The software simplifies and standardizes the often complex process of diagnosis, by allowing doctors to click on the symptoms they see in newborns; the program then puts together a list of the genes that might be most likely to be at fault. Doctors can then compare these genetic suspects to the newborn’s sequenced genome to see if any of the same genes are mutated; if they are, they can pinpoint a diagnosis.

“There is a phenomenal need for more accurate and faster diagnosis in the NICU,” says Kingsmore, adding that “this is a setting where we know that giving treatments is one of the most effective things we can do in medicine from the cost standpoint, since these patients have 65 to 70 years of life to live out.”

Of the 4 million babies born in the U.S. each year, about 1 in 20 are admitted to the NICU for potentially life-threatening reasons, and about 30% of those are for inherited genetic diseases. Accurately diagnosing these babies can help them get effective treatments that can improve their quality of life and in many cases save them from an early death.

Using the combination of the prototype Illumina sequencer and the new software, Kingsmore and his team have sequenced 15 babies’ genomes as part of their study, and have seen how powerful the screening can be. In the case of Pompe disease, for example, in which a genetic abnormality leaves babies deficient in an enzyme that breaks down glycogen (a form of sugar the body uses for energy), the genetic sequencing can pick up the mutation and alert the doctor to begin giving the baby the enzyme, which drug companies make as a therapy. The treatment can keep infants off ventilators and offset some of the heart and muscle damage that Pompe disease causes.

Newborns with Menkes disease can also benefit from the screening; their bodies cannot break down copper, so they need injections of the mineral. Without a genetic screen to confirm the deficiency, however, doctors wouldn’t know to treat them. And giving excess copper to babies who aren’t deficient can be dangerous, leading to copper poisoning, with diarrhea, convulsions and liver failure.

Timing is critical in the NICU, and Kingsmore says the ability to get an accurate diagnosis in two days can lead to dramatic improvements in survival and quality of life for many NICU babies. For now, the screening is only available on an experimental basis, as part of ongoing research, but he anticipates that such genetic testing will become ubiquitous as the price of sequencing continues to drop. Next year, he’s planning to offer the testing to other hospitals that will courier DNA samples to Children’s Mercy. “We expect better outcomes and broader benefits to follow from doing this,” he says. And hopefully many more lives saved.

Alice Park is a writer at TIME. Find her on Twitter at @aliceparkny. You can also continue the discussion on TIME’s Facebook page and on Twitter at @TIME.