Combine the correlation loop with the trend-finding loop (no need for buckets)