grabs results and writes to a file

todo: write files to proper directory