A computational theory of episodic memory formation in the hippocampus