fleshed out respawn script; needs testing