Averagin an array