added more arguments (error for match and pairs_fname for match and check)