Solved surrounded regions problem