added a global declaration, and changed stats sort from cum to cumulative