Fixed the covariance function
Finished restructuring that file