Boiling an egg seems like it should be one of the easiest culinary feats to master. But as anyone who has tried knows, it isn’t. You can end up with rubbery whites, chalky yolks or half the white taken off with the shell.

Here’s why: An egg isn’t one thing, it’s two. The yolk and white have two different compositions, and need to reach different temperatures to get to their best consistencies.

The right temperature for an egg white is 180°F (82°C), explains J. Kenji López-Alt in his new cookbook The Food Lab: Better Home Cooking Through Science. That’s when egg white protein solidifies into a firm, but still tender, un-rubbery white.

But that’s about 10 degrees hotter than the ideal temperature for the egg yolk. Above 170°F (77°C), egg yolks get dry and crumbly. And as the sulfur in the white and the iron in the yolk react, they create ferrous sulfide, which turns yellow yolks an icky green.

Then there’s the peeling to consider: While eggs dropped into boiling water risk overcooking on the edges (the whites) before the yolk even solidifies, eggs that start off in cold water fuse the whites to their shells, which makes peeling a mess.

The Food Lab: Better Home Cooking Through Science by J. Kenji López-Alt. Copyright © 2015, all rights reserved.

The trick, hypothesized Lopez-Alt, was to start the eggs in boiling water so that the whites set without sticking to the shell, then to add ice cubes to bring the temperature back down, before finishing with a long, slow cook. So to test his method and establish the precise timing, López-Alt took the scientific approach—taking one egg out of the water every 30 seconds, to check consistency.

Sure, you could do the same. But the faster approach might be simply to apply his conclusions: For the best egg, with a tender white and fully cooked yolk, bring water to a boil, gently lower your eggs into the water and let them cook for 30 seconds. Then add ice to lower the temperature, let the water boil up again, and cook for 11 minutes at about 190°F. Delicious.