There’s no getting around it: divorce is hard on young kids.

Its effects can be felt in kids’ anxiety as their main support system changes, and parents will often feel the weight of that as they try to figure out the next steps in their family’s life.

For many, that means determining who the kids will live with, and a new study out of Sweden is showing that the answer that promotes the best mental health outcome is: both of you.

As published in Acta Pædiatrica, the paper looked at preschool children living in “joint physical custody” (spending equal time in each parent’s home) versus those who lived mostly or only with one parent, and compared them to a preschool population who lived with both parents.

After adjusting for sociodemographic factors, it was found that those kids who spent equal time with both parents had fewer psychological problems than those who were only in one parent’s custody — and the joint-custody kids were essentially on par with the kids from intact families.

The study’s authors noted a few reasons why that might be the case, especially in light of other perspectives that called into question the instability of moving a child from house to house.

“Possibly, the child’s access to two involved parents may instead be more important for children’s psychological well-being than the problems associated with moving between homes,” they noted. “Having an involved father has been shown, in numerous studies, to be especially important for children’s mental health and development.

“In addition, both parents might experience less parenting stress by being able to better balance work and parenting duties and recuperate, due to being child-free every other week. Less stress along with more designated child time could lead to better parenting practices and more engagement in activities with the child, promoting the child’s development and well-being.”

In short, shared custody seems to have positive results for both the kids and the parents, which is what everyone is looking for.

Parents, meanwhile, have been coming up with innovative ways to deal with divorce for the past few years, no longer settling into the stereotypical “staying with dad every other weekend” model.

One such arrangement, called “nesting,” sees the kids staying in the house, while the parents are the ones who move in and out, the Toronto Star reported. This not only gives the children stability, but also has several practical aspects, such as getting to school and extracurricular activities, and only needing one set of, well, everything.

This all depends, of course, on the parents being able to agree on these tactics, which in itself has been found to be helpful to kids’ adjustment levels, even if it’s challenging for the adults.

As HuffPost blogger Amy Arndt notes in describing her friends’ amicable divorce, “Because [the kid’s] parents have made a conscious decision to get along for their son’s benefit, the little boy is going to be okay. In fact, they’re all going to be okay.”

But as parents continue to divorce, finding methods that help your whole family process the situation and move forward can only be a good thing.

If You Want To Help Young Kids After Divorce, Share Custody Of Them: Study