Added statistics class, and basic stats func