Properly arranging the data in the csv