Add distance functions to Utils.