Matching via Distance Profiles