wrapped the calculate covariance matrix function
(#297)
successfully wrapped covariance matrix calculation, fixed indexing bug that I also noticed. Think this is done.
(#297)