averaging an array
fixing merge