(Reuters) - Walmart Inc WMT.N is testing whether independent drivers could deliver its groceries as the retailer races to meet its goal of offering home delivery to more than 100 U.S. cities by the end of the year.

FILE PHOTO: A sign of Walmart is pictured at one of their stores in Monterrey, Mexico, August 8, 2018. Picture taken August 8, 2018. REUTERS/Daniel Becerril/File Photo

The pilot program called Spark Delivery is similar to Amazon Flex, a service from rival Amazon.com Inc AMZN.O where a fleet of drivers use their own cars to make fast deliveries.

Walmart’s Spark Delivery is a crowdsourced platform, which works with independent drivers who partner with Delivery Drivers Inc, a separate firm that manages such workers.

The initiative is Walmart’s latest attempt to tackle one of the biggest challenges in retail: the so-called “last mile” of delivering goods to online customers. Despite having 4,700 U.S. stores within 10 miles (16 km) of 90 percent of the U.S. population, the Bentonville, Arkansas based retailer is still trying to figure out how to efficiently make deliveries and has poured billions of dollars into ecommerce in recent years.

Walmart is the largest U.S. seller of groceries and its aggressive expansion into home delivery follows Amazon’s purchase of Whole Foods in 2017, which spurred several traditional retailers to push such services fearing increased competition in the sector.

Walmart has so far had mixed success with its various delivery initiatives. Reuters was first to report the end of Walmart’s delivery partnerships with Uber and Lyft and how in a separate trial the retailer struggled to get its own employees to deliver groceries to customers’ homes after completing their usual shifts of up to nine hours.

In March, Walmart said it will offer home delivery of groceries to 100 U.S. cities covering 40 percent of U.S. households by the end of 2018 and has since tied up with several small delivery companies like Doordash and Postmates, who offer gig-style jobs to workers, to meet its goal.

As of Wednesday, Walmart said its grocery home delivery service is available in nearly 50 markets including Atlanta, Chicago, Denver, Miami and Seattle.

The company said its work with third-party delivery providers will continue to be a leading part of its delivery strategy even as it runs this pilot.

“Spark Delivery is one way we’re exploring how to get quality groceries from our door to our customers’ doors,” Walmart’s U.S. CEO Greg Foran said in a statement.

Spark uses Walmart’s in-house platform to allow drivers to sign up for time slots that work best with their schedules and offers navigation assistance among other services.

Walmart said its partner Delivery Drivers will handle recruiting, screening, background checks, payment and accounting, among other services for drivers.

A Walmart spokeswoman told Reuters, drivers will earn a fee on each delivery along with the gratuity they receive from customers. Dependent upon the number of orders delivered, driver’s pay can exceed $20 an hour, she said.

Rival Amazon Flex pays independent drivers $18 to $25 an hour for deliveries, and the fuel costs are borne by the driver, according to the Amazon Flex website.

Spark Delivery is currently being tested in Nashville and New Orleans with plans to roll out to a few more metro areas this year, Walmart said without offering more details.