added PrintWriter to print to a agentreport.txt file.