better calculation of the average size of an element