Added correlation calculation and file dump