Owing to their miraculous powers, priests could determine whether a man should spend eternity in heaven or in hell. If he died while excommunicate, he went to hell; if he died after priests had performed all the proper ceremonies, he would ultimately go to heaven provided he had duly repented and confessed. Before going to heaven, however, he would have to spend some time—perhaps a very long time—suffering the pains of purgatory. Priests could shorten this time by saying masses for his soul, which they were willing to do for a suitable money payment.