MOORHEAD, Minn.-Lisa Twomey of Moorhead has four young sons ages 4 to 11 and works full-time.

So how does she do it?

"You just have to be creative," said the Concordia College world language and culture professor who has been able to work things out with her husband, pharmacist Miguel Buisan, and her employer over the years.

She's one in the vast army of working moms in Minnesota, a state that was ranked the second best in the nation for working moms as Mother's Day nears.

North Dakota at 19th and South Dakota at 34th were further down in the rankings, but also won high marks in a few categories, according to a study released this week by personal-finance website WalletHub.

The rankings were based on day-care quality, median women's salaries and female unemployment rates, among other categories.

Minnesota finished behind only Vermont as it ranked third in professional opportunities, fifth in child-care quality and ninth in work-life balance.

North Dakota shined in its unemployment rate for women, with a 2.4 percent rate, compared to the highest in the District of Columbia at 7.5 percent. The state was also tied for third in best day-care system, behind only New York and Washington. But it was at the bottom, ranking 50th, by having the highest gender pay gap.

For South Dakota, it was No. 1 for having the highest ratio of female executives to male executives at 79.39 percent, way above the lowest ratio in Utah at 25.81 percent. South Dakota also was fourth in the most affordable child-care costs.

Nationwide, women make up nearly half of the U.S. workforce, and more than 70 percent of moms with children younger than 18 are working. Yet women earned only 83 percent of what men made in 2015 and have far less upward mobility, as evidenced by the fact that only 5.8 percent of S&P 500 companies' chief executives are female, said the study.

The real question, however, is what is being done about this fundamental problem of workplace inequality, said the study.

"Progress appears to be taking shape at different rates across the nation. Not only do parental leave policies and other legal support systems vary by state, but the quality of infrastructure - from cost-effective day care to public schools - is also far from uniform as well," said the analysis of public and private data by WalletHub.

Molly Flaspohler, a librarian at Minnesota State University Moorhead and the mother of two girls ages 13 and 14, said she believes the state offers some of the best educational and cultural opportunities.

She also notes that the violence seen in so many places around the nation-especially in bigger cities-is less of a problem.

"I don't think I have to worry as much as some mothers," she said.

Both Flaspohler and Twomey, however, even though they have husbands to help and enjoyed understanding employers during their children's earlier years, said it's not easy.

Flaspohler said flexibility is a key to making things work in balancing work and raising children.

She said at one point she worked nights and her husband worked days so one or the other was home most of the time.

"But the problem there is that my husband and I never saw each other," she said. "And it was exhausting."

The couple also had a hard time finding infant care, and she believes that is still a problem.

After starting her new job at MSUM a few years ago, she also still seemingly spends more time than even her daughters at home in front of her computer "going the extra mile" to earn tenure at the university.

Twomey said she was able to take a leave of absence when her first boys were born-something she felt she had to do because she wasn't being fair to either her job or children.

"I realize I was pretty lucky to be able to do that. I know some mothers don't have that choice," Twomey said.

"But I love my job and I love being a mom," she said. So she tries to be that creative person to make things work. She said her husband once switched to four-day work weeks. She also tries to juggle her work schedule around being home with the boys, and sometimes it simply is the "goodness" of the people that she works with.

For a look at the entire study: