Starbucks has been donating things like leftover muffins to food banks for the past six years. For safety reasons, they couldn't do it with things like sandwiches and salads that had to stay refrigerated.

So they had to throw all that stuff out, even if it was still fine to eat.

(Getty Images)

Yesterday they announced that they figured out a way to make it happen. Within five years, they'll be donating virtually all of their leftover food. They're working with a charity called Feeding America, and they'll have refrigerated vans pick up food from about 7,600 Starbucks locations around the country each day.

They plan to have it up and running within a year, donate about five million meals in the first 12 months and 50 million over the next five years. Since they'll already have the trucks, they're trying to get other restaurants to get on board and donate too.

Read more at Starbucks.