A top-down perspective on dopamine, motivation and memory