started to implement refinement algorithms