A large majority of Swiss voters approved a referendum to outlaw homophobia, with punishments ranging from a fine to three years in jail, according to The Daily Caller.

The legislation was put to a broader popular vote as a result of Switzerland’s referendum system, where if enough voters want to have a direct vote on proposed legislation, such a vote will be held. The referendum saw 62 percent of Swiss voters approve the new law.

The law covers “discrimination, hate speech, and other forms of public insults aimed at homosexuals because of their sexual orientation.” This is in addition to already-existing laws against “discrimination based on race, ethnicity, and religion.” The law allegedly does not affect homophobic comments made in private, or jokes about homosexuals.