Added some basic stats routines.