Smarter csv working