Many childhood memories take place at a fast food joint, the taste of a cheeseburger made better with a Happy Meal toy by its side. Unfortunately — or fortunately, depending on how you look at it — the truth about fast food’s health risks have emerged in recent years. A new study finds, however, that the food doesn’t only cause obesity and its related diseases, but it may also impede a child’s educational attainment.

It’s well known that eating fast food often increases a child’s risk of obesity. Despite promises they’d change ingredients, many restaurants’ food still contain lots of calories, as well as high levels of saturated fat and sodium. Their inclusion of fruits, vegetables, and grains remained the same, according to a 2013 study. Eating these types of food four or five times a week isn’t the right way to have a balanced diet, and leads to obesity among other conditions, such as high blood pressure, asthma, and type 2 diabetes.

The new study found that children who frequently ate fast food tended to perform poorly in tests of reading and literacy, math, and science. These findings held even after accounting for other foods the kids ate, how much TV they watched, the neighborhoods they came from, and their families’ socioeconomic status — these last two are important because poverty has been linked to increased fast food consumption.

“We went as far as we could to control four and take into account all the known factors that could be involved in how well children did on these tests,” said Kelly Purtell, lead author of the study and assistant professor of human sciences at The Ohio State University, in a press release.

The researchers looked at data from the Early Childhood Longitudinal Study-Kindergarten Cohort, which included about 11,700 students who attended kindergarten in the 1998 to 1999 school year. The students were tested when they reached fifth grade in all the aforementioned academic areas and also completed a questionnaire regarding their food eating habits. Then, they took another group of tests in the eighth grade.

The researchers found that most kids fell around the middle mark when it came to eating fast food, with over half eating it one to three times in the week preceding the survey. And about a third skipped out on fast food entirely during the previous week. Ten percent of the kids, meanwhile, ate fast food every day, while another 10 percent ate it four to six times that week. Those who fell in these last two categories fared significantly worse on the exams than their fast food-skipping counterparts.

Although these findings didn’t prove causality, the team said a possible reason for lower test scores was that the children weren’t getting certain nutrients that are absent in fast food, such as iron, which boosts cognitive development. They also noted that sugar and fats can hinder memory and learning processes. The research shows the importance of providing a child with a balanced diet, full of vegetables, fruits, whole grains, seafood, and lean meats.

Source: Purtell K, Gershoff E. Fast Food Consumption and Academic Growth in Late Childhood. Clinical Pediatrics. 2014.