It goes without saying that the past two years have not been fun for McDonald’s shareholders. Shares of the fast food giant have barely budged over the past two years, while the S&P 500 has surged 40% in that time. McDonald’s is suffering a number of blows, including an eroding public image in the United States and a food supply scandal that took a bite out of sales in China, a crucial emerging market. Jessica Wohl at The Chicago Tribute wrote “McDonald's tried to overcome issues around the world ranging from diners' changing preferences to food safety concerns, but sales fell at both its franchise locations and those the company operates.” Now, McDonald’s says it will be less aggressive in building new restaurants this year than in previous years. Capital spending will come in at $2 billion in 2015, down from $2.8 billion last year. But while nearly everyone is piling on McDonald's for all it's doing wrong, it's worth noting that there are plans in place to engineer a turnaround. For all its problems, McDonald’s still generates a lot of cash because it enjoys massive scale. Despite deteriorating comparable restaurant sales, McDonald's still brought in more than $6 billion in operating profit in the past three quarters combined. In turn, it funneled more than $4 billion of cash to investors through dividends and share repurchases. McDonald’s is a cheap stock, valued at just 16 times earnings per share and it offers a 3.8% dividend. If the company can turn things around, right now may be a great buying opportunity.