solution to surrounded regions