Create extractandcostdist.py