Pass numStats by reference