Cognitive flexibility and memory in pigeons, human children, and adults