new code for stat class