better stats implementation