Find the average of an array