According to Zoroaster, a good and evil force struggled for mastery in the universe. Humanity had to decide on which side to align itself in this fateful contest. This dualism was greatly elaborated in later Zoroastrianism. Good, personified as the god Ormazd, and evil, personified as the demonic Ahriman, would contend for 12,000 years with varying fortune. At last Ormazd would triumph, and Saoshyans, his agent, would resurrect the dead for judgment. The righteous would pass to their reward in heaven, and the wicked would be cast into hell. But this situation was of temporary duration. A meteor would later strike the earth, causing a flood of molten metal. Through this flood all would have to pass as an ordeal of purgation. The sensitivity of each to the anguish would be determined by the degree of his guilt. After the ordeal, all humans would become immortal, and all that Ahriman had harmed or corrupted would be renewed. Salvation thus took the form of deliverance from postmortem suffering, for ultimate restoration was assured to all after suffering the degree of purgation that the nature of their earthly lives entailed.