Amazon announced Friday it would purchase struggling organic grocer Whole Foods for $13.7 billion, and with Whole Foods stock price falling since a peak in 2013, many are wondering how Amazon — and its record of innovation and technology — could save the once ascendant organic grocer.

“Millions of people love Whole Foods Market because they offer the best natural and organic foods, and they make it fun to eat healthy,” said Jeff Bezos, Amazon founder and CEO in a statement. “Whole Foods Market has been satisfying, delighting and nourishing customers for nearly four decades – they’re doing an amazing job and we want that to continue.”

The move could be advantageous to Amazon, which has struggled to break into the food retail market in recent years, by providing them with about 450 brick-and-mortar stores in 42 states. But to make the Whole Foods acquisition truly worthwhile, Amazon will have to find a way to use its cutting-edge technology to save the struggling chain of grocery stores.

Whole Foods stock
Whole Foods stock shot up on Friday morning after the announcement, but it had been falling.

In February, Whole Foods announced its worst business performance yet, thanks to the proliferation of organic groceries. Whereas Whole Foods was once one of very few grocers to curate its food based on health and wellness, organics are now available everywhere in the country, including Walmart. And technological changes haven’t helped Whole Foods, either. Online grocers like AmazonFresh are increasing competition, as are recipe delivery startups like Blue Apron. Earlier this year, these forces led Whole Foods to close stores and drop prices to bring customers back. Now, it looks like it led them to sell.

While Whole Foods was trending downwards, Amazon’s been rising up. It’s seen growth in numerous sectors, including online sales and brick-and-mortar retail like its physical bookstores. But to maintain its upward growth trajectory, analysts say it will have to put significant resources into largely untapped markets like food and even pharmaceuticals.

Right now, Amazon’s food sales mainly consist of the delivery system AmazonFresh and a single Amazon Go shop in Seattle. AmazonFresh, which after years of testing in Washington recently expanded to cities across the United States and a few abroad, delivers groceries on demand. Amazon Go, which is essentially a grocery laboratory near the company’s Seattle campus, also allows shoppers to skip the line. Opened to employees in December 2016, it uses sensors to see what customers pick up, so they can walk out with the products and be charged automatically. However, the public opening was delayed due to technical difficulties.

Amazon uses complex algorithms to predict exactly how much of each item users want. In fact, they have a patent for anticipatory package shipping, because they think they can get something ready for you before you even know you want to order it. Using this technology could potentially reduce the cost of storage for Whole Foods by predicting exactly what products will fly off the shelves and win. Excess products or products no one wants could then be reduced or eliminated.

But that would require Amazon keeping Whole Foods stores in something similar to their current form.

Scott Galloway, a professor of marketing at New York University, thinks that’s unlikely to happen. On Thursday Galloway was a guest on the tech podcast Recode Decode, where he basically predicted Amazon’s next move, saying:

Everyone looks to Amazon for leadership and I’ve been predicting they were going to go into stores for five years. I can’t even really legitimately say I’m right, because they don’t have a lot of stores yet. They haven’t found a model that works for them yet. I still believe they’re going to buy a Macy’s, or a Carrefour, or something like that. I can’t imagine why they wouldn’t buy Whole Foods, for example, just because of the urban locations. They could close them down and just turn them into warehouses, and I think they could justify the price.

Galloway’s scenario that Amazon could just close down Whole Foods stores and turn them into warehouses sounds ominous to everybody who stops by the store on the way home from work, but Amazon’s also shown interest in stores, recently with its bookstores. And as Galloway says on the podcast, Whole Foods is a great place to hang out, and that in itself might be worth more than we think.

As we wait for things to shake out, it still might be wise to stock up on your $4 organic avocados.

Photos via Google Finance, Getty Images / Joe Raedle