Updated, now successfully records data to CSV file!