Update to scale the distances and convert them to similarities