solve the surround regions problem.