Update extractandcostdist.py