create tempfiles rather than require caller to pass filenames