I have to admit that when I saw Motley Fool Stock Advisor selection PetSmart (NASDAQ:PETM) trading below $22 in after-hours trading, I thought I might get a chance to add to my position fairly soon at an attractive price. But in regular trading Wednesday, PetSmart's shares quickly moved up, and while I don't think this was the company's best quarter, I understand the reasons behind the optimism.

A summary of PetSmart's year-over-year financial performance can be found in our handy Fool by Numbers published earlier today. Aside from the soft earnings, which I'll talk about a bit more, the decline in gross margins really stands out. The culprit was an accident in the company's Phoenix distribution center. The accident was caused by a poor racking system and led to out-of-stock situations in the company's stores for higher-margin hard goods (non-consumables), and it meant additional investment in the distribution center for new, stronger racks.

Another item that stands out in PetSmart's quarter is $2.9 million in expenses for an acquisition the company ultimately chose not to pursue. Because Petco (NASDAQ:PETC) recently announced it's being acquired, I believe this is the candidate the company was pursuing. With the deal not happening, PetSmart is instead being aggressive with capital spending and plans to pull some investments originally scheduled for 2007 and 2008 into the second half of this year. This means lower results in the second half, but the company expects stronger results in 2007 and 2008. And with Petco about to become more highly leveraged, it's an opportune time for PetSmart to invest in more efficient operations.

One of the bright spots in the quarter was the sales results from PetSmart's service offerings. Overall sales of services were up 28%, which is on top of a 21% increase in the quarter last year. While PetSmart offers more of a variety in pet food and a number of higher-quality brands than you'll find in traditional retailers such as Wal-Mart (NYSE:WMT) and Target (NYSE:TGT), the performance of the services business is important because it brings people in for more trips to PetSmart and makes additional purchases more likely. The services sales are also profitable on their own, but because of their potential to drive loyalty or the habit of purchasing other goods, I view them as very important to making a case for whether or not to invest in PetSmart.

The final bit of good news in the quarter is that PetSmart continues to generate a great deal of cash. Through the first six months of the year, cash balances are up a little more than $60 million and the company finds itself sitting on a total of $390 million. But the really good news for shareholders is that PetSmart announced it intends to repurchase $250 million of its shares over the next 12 months. Assuming the repurchases are executed at prices similar to today's, that would be about 7% of the outstanding shares.

Considering PetSmart's cash-generating capabilities, I continue to find the shares quite attractive. Using a discounted cash flow model and fairly conservative growth estimates, I value the shares at around $29 each. If the company's investments in efficiency pay off, it's quite possible that my estimate will prove to be conservative. Add in the potential for a 7% contraction in the share count and that's a pretty attractive mix to consider investing in.

For more stocks from the top of Tom and David Gardner's list, try a free 30-day guest pass to Stock Advisor .

At the time of publication, Nathan Parmelee owned shares in PetSmart, but had no interest in any of the other companies mentioned. Wal-Mart is a Motley Fool Inside Value selection. The Motley Fool has an ironcladdisclosure policy.