write table is now in main.R, create also csv file