Helping kids get better at math is a struggle for many teachers and parents, not to mention the students themselves. However, it seems like there might be a secret weapon that most of us didn’t expect: physical activity.

A study from the University of Copenhagen has shown that kids learn math better when they’re physically engaged as well.

The 2014 Danish School Reform has put an emphasis on physical activity throughout the school day, based on studies that have shown that increased exercise leads to better academic performance.

In the University of Copenhagen study, one group of students did their math on the floor, drawing shapes with their bodies or using each other to add or subtract with groups. Another group played with LEGO bricks independently or in small groups, and a third used standard instruction techniques with no physical activity at all.

The study followed the students for six weeks. After a national standard test, the children “whose instruction included whole body activity performed best.” Their math scores improved 7.6 percent overall, with almost four correct answers more than the baseline, while the sedentary students had only half as much improvement.

That may not sound like a lot, but that’s over six weeks, not a school year, much less the entirety of primary education. Students don’t have to run laps or do intense exercise to benefit, either. The study showed that lower-intensity activities are just as effective as, or even more effective than, intense activity. The most important factor was the incorporation of movement.

Playing math games or using bricks and blocks are relatively easy activities to introduce to the classroom, meaning that this could be a way to boost mathematics development that would be easy and affordable for teachers to incorporate into their lesson plans.

This finding doesn’t seem to be universally applicable, though. The study also found that when children were grouped by existing math ability, average and above-average children benefited more from the exercise. Children who weren’t very good at math in the first place saw no benefit, at least in the development of their math skills.

“We need to keep this in mind when developing new forms of instruction,” said study lead author Jacob Weinecke, an associate professor at the University of Copenhagen. “The new school reform focuses on, among other things, the incorporation of physical activity…with the aim of improving the motivation, well-being, and learning of all children. However, individual understanding must be taken into account.”