flip surrounded regions