Update demo to use new autoCorrelate() defintion and avoid global vars.