Faster correlation calculation