Simplified the code, save in .txt (with csv separated)