Identity Matching Algorithm