loop through array and call covariance function