Little performance improvement
added stats and getStats() method