For all those longing to create the most gooey, melty and flavorful grilled cheese imaginable, it’s time to start thinking about the science behind the iconic sandwich.

In the latest video from the YouTube series Reactions, the American Chemical Society explains the chemistry of how cheese melts and why that affects the way that it tastes grilled between two slices of bread. Basically, the gooeyness level of cheese when melted is ultimately based on its pH. Cheeses with an acidity in the range of pH 5.3 to 5.5 — such as gouda, gruyére or manchego — are best for being heated up in a sandwich.

When cheeses have a lower pH, aka when they’re “sharper,” they break down more easily, resulting in clumps that are apt to ruin your perfect grilled cheese experience. So when choosing between two types of cheddar, go with the milder one.

For a more in-depth explanation of grilled cheese science, see the full clip below:

Get The Brief. Sign up to receive the top stories you need to know right now. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Megan McCluskey at megan.mccluskey@time.com.