Leah Messer and her ex-husband, Corey Simms, returned to court on Wednesday to fight over the custody of their 6-year-old twins, and fortunately for the girls, the exes were able to come to an agreement.

'Teen Mom 2' Jeremy Calvert Just Bought An Expensive New 'Toy'

After the Teen Mom 2 star lost primary custody of the girls in October, a judge reversed the ruling during her latest court hearing, and now, she is allowed much more time with Ali and Aleeah.

“Leah is doing great,” a source told Us Weekly on Thursday. “She had confidence that she would be proven right and get her custody rights back.”

'Teen Mom 2' Leah Messer Dating T.R. Dues, But Only Because Jeremy Won't Take Her Back?

Although Messer's ex was awarded with primary custody just months ago, leaving him in charge of caring for Ali and Aleeah from Monday until Friday, with Messer having the children only on weekends, Messer will now have the girls from Thursday until Sunday, with Simms taking them on for the remainder of the week.

In addition to their shared times, Messer and Simms will "split the bills 50-50" as they co-parent.

“She was never asking for full custody,” the source explained. “She wants the girls to be able to see their dad.”

In other Messer news, her second husband, Jeremy Calvert, recently confirmed he was back with Brooke Wehr on Instagram.

Leah Messer and her co-stars, including Jenelle Evans, Chelsea Houska and Kailyn Lowry, are currently in production on Teen Mom 2 season seven, which will likely air later this year on MTV.