improved csv conversion