Refactored distance statement using underscores intersection method