The structure of adaptive behavior.