loop through correlation matrix