Refactor the surrounding function. Add surrounding only when the animal is alive.