Adding distance calculation