Rebuilt CSV Export Functionality