fixing bugs on patternMatching/mark5.py ; adding distance penalty; remove "nan" entries from final scores