statistics function
stats updates