add code from WizardSurvival