moving csv_compare to global function for portability