using tempfile like a good person