Cybernetics was the first formal study of intelligence, by considering cybernetic loops – the idea that an animal or a machine exhibits behaviour because its sensors detect something, which affects its controller. The controller performs an action in response that then results in an effect to some external system: its environment. The change is then detected by the sensors, which affect the controller, and so on, in a loop. Cybernetics was the first attempt at understanding intelligence in this way, and those such as Grey Walter who tried to build cybernetic systems were making the first electronic artificial intelligences.