Just in time for July 4th, a new study ranked Wyoming just behind New Hampshire as the second most patriotic state in America.

Wyoming is one of few states where civics courses are required in public schools. The Cowboy State also ranked fifth for the highest percentage of veterans, sixth for per capita volunteer rates, 13th for the percentage of active-duty military personnel, and 15th for the highest percentage of voters in the last presidential election.

Along with New Hampshire and Wyoming, Vermont, Utah, and Idaho ranked among the five most patriotic states. Around the region, Montana finished 12th with the second-highest rate of veterans per capita, Colorado was15th with the third highest percentage of voters, while Nebraska and South Dakota ranked 27th and 32nd, respectively.

New Jersey is the least patriotic state, according to the study. New York, California, West Virginia, and Texas rounded out the bottom five. The rankings were based on 13 individual factors related to military service and civic engagement. Last year, a similar study ranked Wyoming as the third most patriotic state.