make arrays into averages