some more improvements on eval.c: h_dist calculated in new way