Initial version of the script which works out key stats.