updated correct formatting in ouptut for csv writing