implementing stat recording