If you’ve ever delivered packages for a bit of extra spending money, you’re no doubt aware of just how tough it can be to squeeze in stops along a route. Efficiency is the name of the game, and unless you’re a math whiz with a lot of time on your hands, figuring out the fastest path to a destination can be an exercise in frustration.

Thankfully, Bing has your back. Microsoft today announced an improved Bing Maps routing API that uses algorithmic path modeling to save on route time and distance. It automatically reorders stops (up to a total of 25) and uses actual road distance for optimization, which the Bing Maps team claims is “much more accurate” compared to systems that take a straight-line approach.

“Geographic constraints like rivers, lakes and divided highways can really throw [some algorithms] off,” the Bing team wrote in a blog post. “Consider [a] simple route [where] the straight-line distance from A to B is less than half a mile, [b]ut [a] body of water sitting between them makes the actual driving distance 2 miles.”

In a demonstration of the new routing API’s capabilities, the Bing Maps team mapped out a theoretical 6-stop delivery path in Kansas City. The unoptimized route was 131 miles in total, with a driving duration of nearly three hours. Bing’s optimization reduced it to about 100 miles and two and a half hours.

The newly optimized routing API is free of charge — API calls are one billable transaction. It’s available in the Bing Maps REST API, with JavaScript controls to come later this year.

Route optimization is the name of the game in delivery. A British study conducted by researchers from Plymouth University, Cardiff University, Heriot-Watt University, and the Sainsbury’s supermarket chain in the U.K. found that 2.62 percent of total delivery time is taken up by delays such as road restrictions and traffic congestion.