Updated sample cov matrix calculation to include row indices