primarily as a result of a reduction in stock-based compensation expense and decreased corporate legal costs. Fiscal year 2005 legal costs were $2.08 billion as compared to $2.53 billion in fiscal year 2004. The legal costs in both years were primarily related to antitrust and competition law claims brought by competitors, class actions on behalf of end users, and by government regulatory bodies outside the United States. 

In fiscal year 2004, corporate-level expenses increased primarily due to legal costs including a $1.92 billion charge for a settlement with the Sun Microsystems, Inc., and the fine of €497 million ($605 million) imposed by the European Commission. In addition, stock-based compensation increased by $497 million as compared to fiscal year 2003. 

 

Cost of Revenue 

 

Cost of revenue includes manufacturing and distribution costs for products sold and programs licensed, operating costs related to product support service centers and product distribution centers, costs incurred to support and maintain Internet-based products and services, and costs associated with the delivery of consulting services. In addition to a decrease in the cost of revenue in fiscal year 2005 due to lower stock-based compensation expense, the cost of revenue decreased due to a $140 million reduction in costs primarily associated with provisioning the MSN Internet Access business as subscriptions declined and a $169 million reduction in other product costs mainly due to Xbox consoles cost efficiency in Home and Entertainment, partially offset by increased costs in product support and consulting services costs. The increase in fiscal year 2004 was primarily due to increased product support and consulting services costs of $508 million, $214 million of stock-based compensation expense from the employee stock option transfer program, and a lower-of-cost-or-market inventory adjustment in the fourth quarter of fiscal year 2004 of approximately $90 million related to the Xbox console, partially offset by a $365 million decrease in MSN online operations costs. 

 

Research and Development 

 

Research and development expenses include payroll, employee benefits, stock-based compensation, and other headcount-related costs associated with product development. Research and development expenses also include third-party development and programming costs, localization costs incurred to translate software for international markets, and the amortization of purchased software code and services content. Our research and development expenses decreased in fiscal year 2005 due to lower stock-based compensation expense. This expense decline was partially offset by an increase in headcount-related costs associated with incremental hiring and product development costs associated with upcoming products, primarily the Xbox 360 console and related games, SQL Server 2005, Windows Vista, and product development in Mobile and Embedded devices. The increase in fiscal year 2004 was primarily due to $1.31 billion of stock-based compensation expenses related to the option transfer program and other headcount-related payroll and other employee costs associated with a 3% increase in