Added a parameter to the stat function.