added refine.py