If you’re not in Kansas anymore, maybe it’s time to move the gang back.

Overland Park, Kan. — the Sunflower State’s second most populous city — is the best place in the country to raise a family, according to a ranking out Tuesday from personal finance site WalletHub. The city ranks particularly high on affordability (no. 1) and socioeconomics (no. 4).

Rounding out the top five are Madison, Wis.; Plano, Texas; Seattle, Wash.; and Fremont, Calif. New York City places no. 57, Los Angeles clocks in at no. 92, Chicago ranks no. 31 and Dallas is way down the list at no. 110.

The worst place to raise a child out of the United States’ 150 most populated cities is Birmingham, Ala., the state’s largest city, the ranking says. (The city ranks particularly poorly on health and safety, coming in at no. 148.) Detroit, Mich., San Bernardino, Calif., Shreveport, La. and Hialeah, Fla., are the runners-up.

Source: WalletHub

Each state’s weighted score took into account 41 different metrics in the realms of “family fun” (playgrounds, ice rinks and skate parks per capita, walkability and bike score, recreation- and sports-fan friendliness, ideal weather and other factors), health and safety (air and water quality, pediatricians per capita, share of uninsured children, violent- and property- crime rates, etc.), education quality and child care, affordability, and socioeconomic factors like share of two-parent families, separation and divorce rate and unemployment.

Overland Park had the lowest percentage of families living below the poverty level, while Detroit had the highest. New York and Chicago tied for top spots on most playgrounds per capita and most attractions; Hialeah, Fla. had the fewest playgrounds and Moreno Valley, Calif. ranked worst on attractions.

Places including Pittsburgh, Fort Wayne, Ind., Overland Park, Des Moines and Buffalo boasted the most affordable housing. The least affordable, predictably, came in pricey coastal cities like San Francisco, Glendale, Calif., New York, Los Angeles and Boston.

As for ties that bind, three Golden State cities — Fremont, Irvine and San Jose — had the lowest divorce rates. The highest were in Cleveland, Detroit and Birmingham. (With all states reporting except for California, Georgia, Hawaii, Indiana and Minnesota, Iowa posted the lowest divorce rate in 2015 at 1.2 per 1,000 total population, according to the CDC. Arkansas had the highest at 4.8.)