made new algo for stdev and corr from Marco meeting