trying lookuptable distance functions