switched to Tempfile, removed directory tests