using temp files instead