working versino of csv output