MINNEAPOLIS (WCCO) — Minnesota has been ranked among the top 10 most educated states in the country.

The study from Wallethub compared all 50 states by looking at several key factors of a well-educated population, including educational attainment, school quality and achievement gaps between genders and races.

The top three most educated states were Massachusetts, Maryland and Connecticut.

Minnesota ranked ninth, scoring high in educational attainment (No. 8) and struggled slightly in quality of education (No. 18). Educational attainment includes the share of adults with at least a high school diploma.

Wallethub reportedly had Minnesota as the 10th most educated in 2020, so this year is an improvement.

“While the COVID-19 pandemic has made education more difficult in the past year, the prevalence of remote learning has allowed students to continue their studies, and the vaccine should eventually help schooling return to normal,” the study said.

West Virginia was ranked as the least educated state, with Mississippi and Louisiana being second and third least educated, respectively.