mindist and other changes