finding the average values of the respective coordinates