Added code to export results to text file