fixing formatting for outputfile, adding toString