Bug fix on use.cd parameter; replaced max correlation for max CD on the output