Amazon.com Inc. (AMZN) poured billions of dollars into research and development (R&D) last year, surpassing all of corporate America and spending 41% more than 2016 when it was also top of the list.

That’s according to an analysis by Recode, which found the e-commerce giant spent nearly $23 billion on R&D in 2017. Technology companies rounded out the top five, collectively spending $76 billion on R&D last year. The other tech companies that spent the most on R&D were Alphabet (GOOG), Intel Corp. (INTC), Microsoft Corp. (MSFT) and Apple Inc. (AAPL). Alphabet was in second place with R&D spending of $16.6 billion while Intel had spending of $13.1 billion and Microsoft spent $12.3 billion. Apple rounded out the top five with $11.6 billion. Meanwhile, Johnson & Johnson (JNJ) spent $10.4 billion while Ford Motor Co. (F) weighed in with 2017 R&D spending of $8 billion. Potentially telling, International Business Machines Corp. (IBM), once the innovator in techland, spent the least at $5.4 billion. (See also: IBM Traders See Stock Plunging 20%.)

According to Recode, Amazon’s spending has gone to boost its cloud computing business Amazon Web Services (AWS) as well as to beef up Alexa, its voice-activated digital assistant, and to support futuristic projects like its Amazon Go cashierless store, which it rolled out earlier this year.  (See also: Amazon Web Services at $60B In Five Years: Analyst.)

Benefits to GDP

While President Donald Trump has continued his criticism of Amazon in recent days, accusing it of not paying its fair share of taxes and for seemingly harming the U.S. Postal Service, its R&D spending does not only benefit the company. According to Recode, R&D not only helps a company expand and launch innovative products and services but it adds to national productivity, representing 3% of the gross domestic product, or GDP.

Another technology company that has been under fire lately—Facebook Inc. (FB)—also increased its R&D spending last year, jumping to ninth place with spending of $7.8 billion. It was in 13th place in 2016. Recode noted that the increase in spending could be driven by its secretive hardware research lab dubbed Building 8.

Prior to the data scandal involving Cambridge Analytica, in which the data of as many as 87 million Facebook users was accessed without their consent, the Building 8 team was reportedly readying a hardware device that was voice activated and could make video calls. It was supposed to brought out at the company’s developer forum in May, but more work is now being done to ensure there is enough of a trade-off when it comes to the data customers will be sharing with the hardware device. Facebook has the ambitious goal to be involved in more of the everyday lives of consumers. It's not clear how the current scandal will impact those aspirations.