writing a new function to get correlated variables