San Francisco has a reputation among commuters for its terrible traffic, and it’s no wonder: A study by Washington-based traffic data company INRIX earlier this year found that San Franciscans spent an average of 82 hours stuck in traffic in 2016, making the city’s congestion the fourth worst in the world among 1,064 cities across five continents.

Among congestion’s many contributors, the difficulty of finding parking often flies under the radar. But another INRIX study in July of this year found that San Francisco drivers also spend 83 hours a year cruising around just to find a parking spot. The unfortunate circumstance unnecessarily keeps cars on the road, wasting fuel and ultimately generating an economic burden on the city of $655 million a year.

Last week, the city announced a broadened effort to combat the harrowing traffic and search for parking by expanding demand-based parking pricing to the entire city. The change, scheduled to begin at the start of 2018, will include every meter and city-owned lot and garage, making San Francisco the first US city to implement such a comprehensive program.

The program will vary rates by block and by hour to reflect the popularity of neighborhoods, and peak and off hours, based on data collected from the wirelessly connected parking meters. Every three months, the prices will be readjusted based on the occupancy levels observed in the previous quarter. Blocks that consistently have more than 80% occupancy will get a $0.25 hourly price bump; blocks within 60-80% will stay the same; and those under 60% will drop $0.25, with a minimum meter charge of $0.50 per hour and a maximum of $8.

“The goal of this project is really to get people into parking spaces as fast as possible,” Hank Willson, MTA parking policy manager, said at last week’s San Francisco board meeting.

Critics of demand-based pricing often claim that it’s a fancy scheme to increase meter prices and generate more revenue for city government. But in spring of 2011 to 2013, when San Francisco’s Municipal Transportation Agency conducted a federally-funded pilot to test the pricing system, city officials discovered the opposite. Over the two years, compared with two control areas, the cost of parking in the pilot’s seven neighborhoods, 14 garages, and one lot dropped an average of 10 cents per meter, according to Willson. At the same time, a financial analysis showed the city increased its parking revenue by nearly $2 million per year.

The positive effects of the change predicted by MTA also played out: The pilot halved the time it took people to find parking, reduced overly full blocks by 16%, and increased the utilization of emptier blocks by 31%. The city also saw an increase in the pilot area’s sales tax revenue, which suggests a correlation between the pricing scheme and increased traffic to local businesses. In 2014, demand-based pricing became a permanent fixture of the pilot areas.

Several other cities have tested dynamic pricing, including New York, Los Angeles, San Diego, and Seattle, but not yet at a city-wide scale. Other cities are looking to push the concept even further. In its plans to redevelop a part of Toronto, for example, Sidewalk Labs said it would test a program to vary pricing “in real time based on transit availability.“

Wired points out that these schemes tend to produce the desired effects, but they have limitations on their ability to solve the congestion problem. “Road congestion is caused by the road not being priced accurately, not parking,” Michael Manville, an urban planner who studies transportation and land use at UCLA, told the publication.

On the other hand, it has benefits beyond reducing congestion that are important to consider, as Tom Radulovich, executive director of Livable City, noted to NextCity: “It…reduces the bike and pedestrian danger you get when people are cruising for parking or give up and double park.”