Added another loop for averaging given numbers