added shell code for covariance implementation