Memory and its effects on action and motivation