CLARKSBURG, W.Va. (WBOY) — A recent study ranked the best small American cities to live in and gave Morgantown a top-50 score in the nation for quality of life.

Five West Virginia cities were included in the Wallethub ranking: Morgantown, Parkersburg, Charleston, Wheeling and Huntington. A total of 1,319 American cities were ranked based on five main categories: affordability, economic health, education & health, quality of life, and safety.

Nationally, Morgantown was placed in the 73rd percentile overall—in the top 350 cities. The standout for Morgantown was its quality of life ranking, which was 37th in the entire country.

In West Virginia, Morgantown was ranked best but was ranked the least affordable; Parkersburg was second in the state and in the 20th percentile overall, followed by Charleston in the 19th percentile, Wheeling in the 17th percentile and Huntington in the fifth percentile. Overall, West Virginia cities scored higher than average in the quality of life category; Charleston, West Virginia was ranked 58th, and even West Virginia’s lowest-ranked city was in the top 300 for that category.

In general, West Virginia struggled in the economic health and health & education categories. Click here to see the full ranking.