I don't understand why the distances are called `relative_probabilities` here. It'd be clearer if the argument were just called `distances`.