create functions the first time processStats is called