Added average value file back in
Removed old code
Fix issue with GUI using old function