Fixed the issue with calculating the covariance by expressing it as a
matrix product. The result now computes in a reasonable amount of time.