Refinement function call and better input files