public static function diffTolerance($filepath1, $filepath2, array $tolerances, $compareOtherColumns = true, $delimiter=",", $enclosure='"')
    {
        $hasFailed = false;
        $humanRowNumber = 1;
        $fileHandle1 = fopen($filepath1, "r");
        $fileHandle2 = fopen($filepath2, "r");
        
        if (!$fileHandle1 || !$fileHandle2)
        {
            throw new \Exception("diffTolerance: Failed to open CSV files for comparison.");
        }
        
        while (!feof($fileHandle1) && $hasFailed === FALSE)
        {
            $lineArray1 = fgetcsv($fileHandle1, 0, $delimiter, $enclosure);
            $lineArray2 = fgetcsv($fileHandle2, 0, $delimiter, $enclosure);
            
            if ($lineArray1)
            {
                foreach ($lineArray1 as $index => $value1)
                {
                    $humanColumnNumber = $index + 1;
                    
                    if (!isset($lineArray2[$index]))
                    {
                        throw new \Exception("decimalDiff: rows do not have the same column count.");
                    }
                    
                    $value2 = $lineArray2[$index];
                    
                    if ($compareOtherColumns || (isset($tolerances[$humanColumnNumber])))
                    {
                        if (is_numeric($value1) && is_numeric($value2))
                        {
                            $numericDifference = abs($value1 - $value2);
                            
                            if (isset($tolerances[$humanColumnNumber]))
                            {
                                if ($numericDifference > $tolerances[$humanColumnNumber])
                                {
                                    $hasFailed = TRUE;
                                }
                            }
                            else
                            {
                                if ($numericDifference > 0) // can't use !== on the values as 1.100 !== 1.1
                                {
                                    $hasFailed = TRUE;
                                }
                            }
                        }
                        else
                        {
                            // comparing non numeric values...
                            if (isset($tolerances[$humanColumnNumber]))
                            {
                                $msg = "diffTolerance: Trying to perform numeric tolerance " . 
                                       "diff on non numeric column. Column: $humanColumnNumber " . 
                                       "Row: $humanRowNumber";
                                
                                throw new \Exception($msg);
                            }
                        }
                    }
                    else
                    {
                        // Skip this column as we don't wish to check it.
                    }
                }
            }
            
            $humanRowNumber++;
        }
        
        fclose($fileHandle1);
        fclose($fileHandle2);
        
        $passed = !$hasFailed;
        return $passed;
    }