Now you can count them before they’re hatched.

Or at least sex them. Yes, so, if you’re not up on your poultry husbandry, sexing chickens is a big thing – an enormous thing. Girl chickens grow up to lay eggs. Boy chickens – we call them “roosters” – grow up to… well, make a lot of noise, and then a few fertile eggs from which the whole process starts over. And maybe some drumsticks. We like having a lot more hens than roosters. Billions of young roosters-to-be are killed every year… as soon as they’re old enough for us to tell.

So when Scientific American comes out with a way to tell the sex of a chicken when it’s still in the egg, it’s big news:

Currently, the sex of chicks can be determined before they hatch by sampling hormone levels or DNA from within the egg after removing a piece of shell. But hormonal tests must be done on about day nine of development, and chicks become sensitive to pain at about day seven, says Roberta Galli of Dresden University of Technology. Moreover, these testing methods require taking a sample from each egg, followed by chemical analysis, which may not be feasible on an industrial scale.

Galli and her colleagues wanted to develop a less invasive method that could be applied earlier in development. The team has used Raman spectroscopy for other sensitive biomedical applications, so they thought the approach might be able to determine sex, which imparts differences to blood biochemistry. Male blood has different protein and sugar profiles and about 2% more DNA than female blood.

The method the team developed uses a laser to cut a 15-mm-diameter circle in the end of an eggshell. When the researchers remove the shell piece on day three of development, the embryo’s blood vessels are visible. They shine near-infrared light on the vessels and detect the scattering with a Raman spectrometer; the spectrum is rapidly assigned to a sex based on algorithms the team developed. For 101 eggs whose sex was also determined by DNA test, the algorithm correctly identified embryo sex in 90% of cases. However, Galli says they have since optimized the system, nudging the accuracy to 95%—closer to the 98% accuracy of manual sex determination used in industry based on examining the feathers or genitals.