tidied up internet detection code, fixed bug in ave cpu calculation