vectorized correlation matrix and derivatives calculations, and built a profiler