During the age of the dinosaurs, the arrival of flowering plants as competitors could have spelled doom for primitive ferns. Instead, ferns diversified and flourished under the new canopy — using a mysterious gene that helped them adapt to low-light environments. Scientists have now pinpointed the curious origins of this gene and determined that it was transferred to ferns from a group of unassuming, mossy plants called hornworts.