COWBOY :112 distance function fix