WASHINGTON (AP) – Homelessness is declining overall in the U.S., according to new data from the federal government.

But there are cities and states where homelessness is on the rise.

The Department of Housing and Urban Development said Thursday many cities in the West are struggling with homelessness. They say a lack of affordable housing and growing problems with opioid addiction are contributing to the problem.

Nationwide, veteran homelessness has decreased dramatically in the last several years. Officials credit a program initiated by President Barack Obama urging communities to have a plan in place to prevent and reduce homelessness.

They hope communities apply what they’ve learned helping veterans to other groups with high rates of homelessness.

The federal government releases the numbers after volunteers across the country count homeless people in their local areas.