added ability to save correlation data to file