Michael Saylor’s MicroStrategy (MSTR) booked a far smaller accounting writedown tied to its bitcoin (BTC) hoard last quarter versus the final three months of 2022, helped by the cryptocurrency’s giant rally to begin the year.

MicroStrategy’s impairment loss was $18.9 million for the first quarter, down from the fourth quarter’s $197.6 million and the $170.1 million loss a year earlier, according to a statement Monday.

The company also bought more bitcoin in the first quarter, bringing its holdings to 140,000, and pre-paid its Silvergate loan.

“We strengthened our capital structure by reducing leverage by fully repaying our bitcoin-backed loan. We also continued to strategically manage our balance sheet through the addition of 7,500 bitcoin in the quarter,” said Chief Financial Officer Andrew Kang said in the statement. “The conviction in our bitcoin strategy remains strong as the digital asset environment continues to mature.”

Shares of the business-software company rose about 2% in after-hours trading on Monday, following the release of the quarterly results.