fixed merge for cost.py