added hacked distances for feintzeig's code