Cleaned up some code, added nonZeroCorrelation