fixed flattening in find_dist_vs_core.py