Merge in pull request #13 with new function to find total hits

Hi,

I've merged in pull request #13, fixed the issue with $res variable that you noticed, and merged in a new function called getTotalHits().  Would you review this and consider merging?

Thanks,
Jay