fixup! add distance scalar function