can now pass distance heuristic to pather
split out to util