Create stats.cs

Basic statistics functions