better implementation of the csv writer

Use sums of lists and avoid for-loops building the ‘line-string’