stats implementation