Added some logic to file pairing algorithm. Added _filter_files().