fingerprint match algorithm