Matching function now penalizes distances more harshly