Recognizing and avoiding dangers