Fixed covariance tables. Working on refactoring.