getStats method added.