clean up allocStats function.