stores numbers in array and get their average