Changing csv writer to be optimized.