refactoring: extracting distance function
ADD: influence map classe