Cognition, social behavior, and the environment