Sorry ... my bad, didn't look at message properly, was just silly warning about maxdepth.
Although I have now run it again and found our outputs differ quite dramatically and it seems to behave oddly :$
So the directory I am running on has 11 files and 3 directories (including . & ..)
NUMFILES correctly records 11
But the for loop has 82 iterations??? and at the end has a total of 611878 where mine (and calculator) shows 13947542
Then obviously the math comes out different for the average
Edit: <DOH> just figured it out ... the following line when run on its own does the ls -la of where I am and not from the find info:
find . -type f -maxdepth 1 | ls -la
I had altered the find to be a directory not .
So the find is not required at all