first version of the new covaraince calculation
toooo many changes... i am getting closer