Implemented refine() but only working for two points