Improved correlation computation