implemented stat updating