updating to calculate stats