Canada is one of the freest democracies in the world, while U.S. democracy is getting more flawed, according to a new study.

The Economist Intelligence Unit's 2016 Democracy Index looked at the state of democracy in 165 nations and two territories around the world.

The index ranks countries based on five categories — "electoral process and pluralism; civil liberties; the functioning of government; political participation; and political culture."

The countries are then classified into one of four types of governments: "full democracy," "flawed democracy," "hybrid regime," and "authoritarian regime."

Canada ranked as the sixth freest "full democracy" in the world, receiving a 9.15 score out of 10. It's Canada's highest ranking in the study so far; the country previously sat at 9.08 for several years.