Adjusted average.sh to produce average instead of sums