Learning and Memory: How it Works and When it Fails