Teen Mom 2 star Leah Messer has regained joint custody of her twins Aliannah and Aleeah, who she shares with ex-husband Corey Simms.

Messer lost custody in October after Simms accused her of drug use, failing to get their daughters to school on time and more.

A source told Us Weekly Messer will now have the girls from Thursday to Sunday and Simms will have them the rest of the week. The insider said they simply "came to an agreement that works best for the girls."

Messer was determined to prove to a West Virginia judge that she was getting her daughters to school on time and once she presented the proof, the judge threw out the ruling of giving Simms full custody.

“[Leah] proved in court that the kids were not tardy to school, so the judge said there was no reason the kids shouldn’t be with their mom predominantly,” said the source.

Messer also shares 2-year-old daughter Adalynn with her other ex-husband, Jeremy Calvert.