Tidied code and improved file contents matching to ensure both files have the same number of rows to avoid false positives.