This function is minimized to get covariances
Trying to introduce covariance estimation